Routes
The following route classes provide access to specific API endpoints.
Important
With the default Gwapes API, only ItemsRoute is supported. Every other
route below is retained for API compatibility and raises
dankmemer.exceptions.UnsupportedRouteException before making an
HTTP request. Explicit non-Gwapes base_url clients retain the legacy
behaviour for compatible custom servers.
Items Route and Filter
Gwapes provides name, attachment, value, net_value, and a
combined type. These map to name, imageURL, marketValue,
netValue, rarity, and type. All other legacy Item fields are
None.
- class dankmemer.routes.items.Item(id, name, details, emoji, flavor, hasUse, imageURL, itemKey, marketValue, netValue, rarity, skins, tags, type, value)[source]
Represents an individual item obtained from the DankAlert API.
This immutable class encapsulates all relevant attributes that describe an item, such as its identifier, name, details, and various numeric properties. It is designed to allow users to interact with item data in a Pythonic way.
- id
The unique identifier of the item.
- Type:
int
- name
The name of the item.
- Type:
str
- details
Additional details or description of the item.
- Type:
str
- emoji
An emoji representation associated with the item.
- Type:
str
- flavor
A short flavor text providing context or description for the item.
- Type:
str
- hasUse
Indicates whether the item has a usable function.
- Type:
bool
- imageURL
The URL pointing to the item’s image.
- Type:
str
- itemKey
A unique string key for the item (e.g. “trash”).
- Type:
str
- marketValue
The market value of the item.
- Type:
int
- netValue
The net value of the item.
- Type:
int
- rarity
The rarity classification of the item (e.g. “Common”, “Rare”).
- Type:
str
- skins
A dictionary of available skins for the item.
- Type:
Dict[str, Any]
- tags
A dictionary of tags associated with the item.
- Type:
Dict[str, Any]
- type
The type or category of the item (e.g. “Sellable”, “Loot Box”).
- Type:
str
- value
The intrinsic value or base price of the item.
- Type:
int
- class dankmemer.routes.items.ItemsFilter(id=None, name=None, details=None, emoji=None, flavor=None, hasUse=None, imageURL=None, itemKey=None, marketValue=None, netValue=None, rarity=None, skins=None, tags=None, type=None, value=None, limit=None)[source]
Filter for /items data. For string fields, supply a raw string for an exact match or wrap the string in Fuzzy for fuzzy matching. Numeric fields accept a single number for exact matching or a tuple (min, max) for range filtering.
- Supported filterable attributes:
id: Filter by item ID.
name: Filter by item name.
details: Filter by details.
emoji: Filter by emoji.
flavor: Filter by flavor.
hasUse: Filter by use flag.
imageURL: Filter by image URL.
itemKey: Filter by item key.
marketValue: Filter by market value.
netValue: Filter by net value.
rarity: Filter by rarity.
skins: Filter by skins (exact match).
tags: Filter by tags (exact match).
type: Filter by type.
value: Filter by value.
limit: Maximum number of results returned.
Examples
from dankmemer import Fuzzy, ItemsFilter, IN, Above, Below, Range # Exact string matching for the 'name' field. filter_exact = ItemsFilter(name="Trash") # Fuzzy matching example for the 'name' field: filter_fuzzy = ItemsFilter(name=Fuzzy("trash", cutoff=80)) # Using IN for membership matching. filter_in = ItemsFilter(name=IN("melmsie")) # Numeric filtering: filtering 'netValue' for an exact match. filter_numeric = ItemsFilter(netValue=100) # Numeric filtering with a tuple. filter_range = ItemsFilter(marketValue=(5000, 10000000)) # Numeric filtering with interfaces. filter_numeric = ItemsFilter(netValue=Above(10000)) filter_numeric2 = ItemsFilter(netValue=Below(100000)) filter_numeric3 = ItemsFilter(netValue=Range(100, 100000)) # Boolean filtering. filter_bool = ItemsFilter(hasUse=True)
- class dankmemer.routes.items.ItemsRoute(client, cache_ttl)[source]
Represents the /items endpoint, converting raw API data into python objects and providing route-specific filtering.
- async iter_query(item_filter=None)[source]
Asynchronously iterates over items from the /items endpoint.
If an ItemsFilter is provided, only items matching the filter criteria are yielded.
- Return type:
AsyncIterator[Item]- Yields:
Each Item object from the query results.
- async query(item_filter=None)[source]
Retrieve the list of Items from the /items endpoint.
If no filter is provided, all cached items are returned. Otherwise, the provided ItemsFilter is applied and only items matching the filter criteria are returned.
- Parameters:
item_filter (
Optional[ItemsFilter]) – Optional ItemsFilter instance containing filtering criteria.- Return type:
List[Item]- Returns:
A list of Item objects.
NPCs Route and Filter
- class dankmemer.routes.npcs.NPC(id, name, imageURL, extra)[source]
Represents an NPC from the DankAlert API.
- id
The unique identifier for the NPC.
- Type:
str
- name
The NPC’s display name.
- Type:
str
- imageURL
The URL of the NPC’s image.
- Type:
str
- extra
Additional data (including bio, emotions, locations, nickname, reputation, rewards). Access via dot notation is supported.
- Type:
Dict[str, Any]
- class dankmemer.routes.npcs.NPCsFilter(id=None, name=None, imageURL=None, bio=None, nickname=None, reputation=None, locations=None, limit=None)[source]
Filter for /npcs data.
- You can filter on:
id: (str) exact match.
name: (str or Fuzzy) string matching (fuzzy matching if wrapped in Fuzzy).
imageURL: (str or Fuzzy) match on image URL.
bio: (str or Fuzzy) fuzzy/exact match applied to the NPC’s extra.bio.
nickname: (str or Fuzzy) match on the extra.nickname field.
reputation: (int or Tuple[int,int]) numeric filtering on extra.reputation.
locations: (str or Fuzzy) matches if any location in extra.locations matches.
limit: (int) maximum number of results.
Examples
from dankmemer import NPCsFilter, Fuzzy, IN, Above, Below, Range # Exact string matching for the 'name' field. filter_exact = NPCsFilter(name="Chad") # Fuzzy matching example for the 'name' field: filter_fuzzy = NPCsFilter(name=Fuzzy("chad", cutoff=75)) # Using IN for membership matching. filter_in = NPCsFilter(name=IN("chad", "brad")) # Numeric filtering: filtering 'reputation' for an exact match. filter_numeric = NPCsFilter(reputation=30) # Numeric filtering with a tuple. filter_range = NPCsFilter(reputation=(10, 50)) # Numeric filtering with interfaces. filter_above = NPCsFilter(reputation=Above(20)) filter_below = NPCsFilter(reputation=Below(50)) filter_range_interface = NPCsFilter(reputation=Range(10, 50))
- class dankmemer.routes.npcs.NPCsRoute(client, cache_ttl)[source]
Represents the /npcs endpoint, converting raw API data into Python objects and providing route-specific filtering.
Baits Route and Filter
- class dankmemer.routes.baits.Bait(id, name, imageURL, extra)[source]
Represents a bait from the DankAlert API.
- id
The unique identifier of the bait.
- Type:
str
- name
The name of the bait.
- Type:
str
- imageURL
The URL pointing to the bait’s image.
- Type:
str
- extra
Additional bait data, including: - explanation (str): Explanation of the bait’s effects. - flavor (str): Flavor text. - idle (bool): Whether the bait is considered idle. - usage (int): The usage value of the bait.
- Type:
Dict[str, Any]
- class dankmemer.routes.baits.BaitsFilter(id=None, name=None, imageURL=None, explanation=None, flavor=None, idle=None, usage=None, limit=None)[source]
Filter for /baits data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy using Fuzzy or membership using IN).
imageURL: (StringFilterType) matching on the bait image URL.
explanation: (StringFilterType) filter applied on extra.explanation.
flavor: (StringFilterType) filter applied on extra.flavor.
idle: (BooleanType) filter by the ‘idle’ flag in extra.
usage: (NumericFilterType) numeric filtering on extra.usage.
limit: (int) maximum number of results.
Examples
from dankmemer import BaitsFilter, Fuzzy, IN, Above, Below, Range # Exact string matching for bait name. filter_exact = BaitsFilter(name="Golden Bait") # Fuzzy matching for bait name. filter_fuzzy = BaitsFilter(name=Fuzzy("golden", cutoff=80)) # Membership matching using IN for bait name. filter_in = BaitsFilter(name=IN("golden", "eyeball")) # Numeric filtering on usage. filter_usage = BaitsFilter(usage=Above(5)) # Filtering by idle flag. filter_idle = BaitsFilter(idle=True)
- class dankmemer.routes.baits.BaitsRoute(client, cache_ttl)[source]
Represents the /baits endpoint, converting raw API data into Bait objects and providing route-specific filtering.
- async iter_query(bait_filter=None)[source]
Asynchronously iterates over baits from the /baits endpoint.
If a BaitsFilter is provided, only baits matching the filter criteria are yielded.
- Return type:
AsyncIterator[Bait]- Yields:
Each Bait object from the query results.
- async query(bait_filter=None)[source]
Retrieve the list of Baits from the /baits endpoint.
If no filter is provided, all baits are returned. Otherwise, only the baits matching the provided filter criteria are returned.
- Parameters:
bait_filter (
Optional[BaitsFilter]) – Optional BaitsFilter instance containing filtering criteria.- Return type:
List[Bait]- Returns:
A list of Bait objects.
Buckets Route and Filter
- class dankmemer.routes.buckets.Bucket(id, name, imageURL, extra)[source]
Represents a bucket obtained from the DankAlert API.
- id
The unique identifier for the bucket.
- Type:
str
- name
The name of the bucket.
- Type:
str
- imageURL
The URL of the bucket’s image.
- Type:
str
- extra
Additional bucket data. - flavor (str): A descriptive flavor text. - size (int): The size of the bucket.
- Type:
Dict[str, Any]
- class dankmemer.routes.buckets.BucketsFilter(id=None, name=None, imageURL=None, flavor=None, size=None, limit=None)[source]
Filter for /buckets data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy via Fuzzy, or membership using IN).
imageURL: (StringFilterType) match on the bucket’s image URL.
flavor: (StringFilterType) filtering applied to extra.flavor.
size: (NumericFilterType) numeric filtering on extra.size (supports exact value, tuple range, or interfaces Above, Below, Range).
limit: (int) maximum number of results returned.
Examples
from dankmemer import BucketsFilter, Fuzzy, IN, Above, Below, Range # Exact string matching for the 'name' field. filter_exact = BucketsFilter(name="Golden Bucket") # Fuzzy matching for the 'name' field. filter_fuzzy = BucketsFilter(name=Fuzzy("golden", cutoff=80)) # Membership matching using IN for the 'name' field. filter_in = BucketsFilter(name=IN("bucket")) # Numeric filtering: filtering 'size' for an exact match. filter_numeric = BucketsFilter(size=50) # Numeric filtering with a tuple range. filter_range = BucketsFilter(size=(10, 50)) # Numeric filtering using interfaces. filter_above = BucketsFilter(size=Above(20)) filter_below = BucketsFilter(size=Below(60)) filter_range_interface = BucketsFilter(size=Range(25, 75))
- class dankmemer.routes.buckets.BucketsRoute(client, cache_ttl)[source]
Represents the /buckets endpoint, converting raw API data into Bucket objects and providing route-specific filtering.
- async iter_query(bucket_filter=None)[source]
Asynchronously iterate over Bucket objects from the /buckets endpoint.
- Parameters:
bucket_filter (
Optional[BucketsFilter]) – Optional BucketsFilter instance for filtering.- Yield:
Each Bucket object that matches the filter.
- Return type:
AsyncIterator[Bucket]
- async query(bucket_filter=None)[source]
Retrieve the list of Bucket objects from the /buckets endpoint.
If a BucketsFilter is provided, only buckets matching the criteria are returned.
- Parameters:
bucket_filter (
Optional[BucketsFilter]) – Optional BucketsFilter instance for filtering criteria.- Return type:
List[Bucket]- Returns:
A list of Bucket objects.
Creatures Route and Filter
- class dankmemer.routes.creatures.Creature(id, name, imageURL, extra)[source]
Represents an individual creature obtained from the DankAlert API.
- id
The unique identifier of the creature.
- Type:
str
- name
The name of the creature.
- Type:
str
- imageURL
The URL for the creature’s image.
- Type:
str
- extra
A dictionary of additional creature data. Typically includes: - boss (bool): Whether the creature is a boss. - flavor (str): A short flavor text description. - locations (List[str]): A list of locations where the creature can be found. - mythical (bool): Whether the creature is mythical. - rarity (str): The rarity classification of the creature. - time (dict): Time range information for availability. - variants (List[dict]): Optional list of variant information.
- Type:
Dict[str, Any]
- get_availability_window()[source]
Returns a tuple (start_dt, end_dt) representing the creature’s spawn availability window for the current UTC day.
Uses the creature’s extra[“time”] field (which must contain ‘start’ and ‘end’ as dt_time objects).
If the “full_day” flag is set, returns a window from today’s 00:00 UTC until tomorrow’s 00:00 UTC. Otherwise, if the start datetime is later than the end datetime (indicating the window spans midnight), end_dt is adjusted to the next day.
- Return type:
Tuple[datetime,datetime]- Returns:
A tuple of datetime objects (spawn_start, spawn_end).
- Raises:
ValueError – If the time fields are missing or invalid.
- class dankmemer.routes.creatures.CreaturesFilter(id=None, name=None, imageURL=None, flavor=None, boss=None, mythical=None, rarity=None, locations=None, limit=None)[source]
Filter for /creatures data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy using Fuzzy, or membership using IN).
imageURL: (StringFilterType) match on the creature’s image URL.
flavor: (StringFilterType) applied to extra.flavor.
boss: (BooleanType) filter on extra.boss.
mythical: (BooleanType) filter on extra.mythical.
rarity: (StringFilterType) filter on extra.rarity.
locations: (StringFilterType) matches if any location in extra.locations matches.
limit: (int) maximum number of results returned.
Examples
from dankmemer import CreaturesFilter, Fuzzy, IN, Above, Below, Range # Exact matching on the 'name' field. filter_exact = CreaturesFilter(name="Ahuitzotl") # Fuzzy matching on the 'name' field. filter_fuzzy = CreaturesFilter(name=Fuzzy("ahuitzotl", cutoff=75)) # Membership matching using IN. filter_in = CreaturesFilter(name=IN("blood", "hoop")) # Boolean filtering: filtering by boss status. filter_boss = CreaturesFilter(boss=True) # Filtering by rarity. filter_rarity = CreaturesFilter(rarity="Absurdly Rare") # Filtering by locations. filter_locations = CreaturesFilter(locations=IN("lake"))
- class dankmemer.routes.creatures.CreaturesRoute(client, cache_ttl)[source]
Represents the /creatures endpoint, converting raw API data into Creature objects and providing route-specific filtering.
- async iter_query(creature_filter=None)[source]
Asynchronously iterates over Creature objects from the /creatures endpoint.
If a CreaturesFilter is provided, only creatures matching the filter criteria are yielded.
- Return type:
AsyncIterator[Creature]- Yields:
Each Creature object from the query results.
- async query(creature_filter=None)[source]
Retrieve the list of Creature objects from the /creatures endpoint.
If a CreaturesFilter is provided, only creatures matching the filtering criteria are returned.
- Parameters:
creature_filter (
Optional[CreaturesFilter]) – Optional CreaturesFilter instance containing filtering criteria.- Return type:
List[Creature]- Returns:
A list of Creature objects.
Decorations Route and Filter
- class dankmemer.routes.decorations.Decoration(id, name, imageURL, extra)[source]
Represents a decoration obtained from the DankAlert API.
- id
The unique identifier for the decoration.
- Type:
str
- name
The name of the decoration.
- Type:
str
- imageURL
The URL pointing to the decoration’s image.
- Type:
str
- extra
Additional decoration data, typically including: - flavor (str): A descriptive flavor text.
- Type:
Dict[str, Any]
- class dankmemer.routes.decorations.DecorationsFilter(id=None, name=None, imageURL=None, flavor=None, limit=None)[source]
Filter for /decorations data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy via Fuzzy, or membership using IN).
imageURL: (StringFilterType) matching on the decoration image URL.
flavor: (StringFilterType) filtering applied to extra.flavor.
limit: (int) maximum number of results returned.
Examples
from dankmemer import DecorationsFilter, Fuzzy, IN # Exact matching on name. filter_exact = DecorationsFilter(name="Alien Planet") # Fuzzy matching. filter_fuzzy = DecorationsFilter(name=Fuzzy("alien", cutoff=80)) # Membership matching. filter_in = DecorationsFilter(name=IN("alien", "area-51"))
- class dankmemer.routes.decorations.DecorationsRoute(client, cache_ttl)[source]
Represents the /decorations endpoint, converting raw API data into Decoration objects and providing route-specific filtering.
- async iter_query(deco_filter=None)[source]
Asynchronously iterates over Decoration objects from the /decorations endpoint.
If a DecorationsFilter is provided, only decorations matching the criteria are yielded.
- Parameters:
deco_filter (
Optional[DecorationsFilter]) – Optional DecorationsFilter instance for filtering.- Yield:
Each Decoration object from the query results.
- Return type:
AsyncIterator[Decoration]
- async query(deco_filter=None)[source]
Retrieve the list of Decoration objects from the /decorations endpoint.
If a DecorationsFilter is provided, only decorations matching the filtering criteria are returned.
- Parameters:
deco_filter (
Optional[DecorationsFilter]) – Optional DecorationsFilter instance for filtering criteria.- Return type:
List[Decoration]- Returns:
A list of Decoration objects.
Events Route and Filter
- class dankmemer.routes.events.Event(id, name, imageURL, extra)[source]
Represents an event obtained from the DankAlert API.
- id
The unique identifier for the event.
- Type:
str
- name
The name of the event.
- Type:
str
- imageURL
The URL pointing to the event’s image.
- Type:
str
- extra
Additional event data, typically including: - description (str): A description of the event. - last (List[Union[datetime, str]]): A list of datetime objects representing recent event occurrences.
- Type:
Dict[str, Any]
- class dankmemer.routes.events.EventsFilter(id=None, name=None, imageURL=None, description=None, limit=None)[source]
Filter for /events data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy using Fuzzy, or membership using IN).
imageURL: (StringFilterType) matches on the event image URL.
description: (StringFilterType) filtering applied to extra.description.
limit: (int) maximum number of results returned.
Examples
from dankmemer import EventsFilter, Fuzzy, IN # Exact matching on the 'name' field. filter_exact = EventsFilter(name="Quality Time") # Fuzzy matching on the 'name' field. filter_fuzzy = EventsFilter(name=Fuzzy("2xidlespeed", cutoff=80)) # Membership matching using IN. filter_in = EventsFilter(name=IN("instanttravel"))
- class dankmemer.routes.events.EventsRoute(client, cache_ttl)[source]
Represents the /events endpoint, converting raw API data into Event objects and providing route-specific filtering.
- async iter_query(events_filter=None)[source]
Asynchronously iterates over Event objects from the /events endpoint.
If an EventsFilter is provided, only events matching the filter criteria are yielded.
- Parameters:
events_filter (
Optional[EventsFilter]) – Optional EventsFilter instance for filtering.- Yield:
Each Event object from the query results.
- Return type:
AsyncIterator[Event]
- async query(events_filter=None)[source]
Retrieve the list of Event objects from the /events endpoint.
If an EventsFilter is provided, only events matching the criteria are returned.
- Parameters:
events_filter (
Optional[EventsFilter]) – Optional EventsFilter instance containing filtering criteria.- Return type:
List[Event]- Returns:
A list of Event objects.
Locations Route and Filter
- class dankmemer.routes.locations.Location(id, name, imageURL, extra, rarityFish, variantsData)[source]
Represents a location obtained from the DankAlert API.
- id
The unique identifier for the location.
- Type:
str
- name
The name of the location.
- Type:
str
- imageURL
The URL of the location’s image.
- Type:
str
- extra
A dictionary of additional location data, typically including: - bannerURL (str): URL for the banner image. - creatures (List[str]): List of creature IDs available at this location. - days (List[int]): List of days (0-6) when the location is available. - disabled (bool): Whether the location is disabled. - failChance (int): Chance of failure. - mineChance (int): Chance for mining. - mythicalFish (List[str]): List of mythical fish available. - npcs (List[str]): List of NPC names available. - temporary (bool): Whether the location is temporary. - thumbnailURL (str): URL for the thumbnail image.
- Type:
DotDict
- rarityFish
A mapping of rarity categories to lists of fish.
- Type:
Dict[str, List[str]]
- variantsData
Data on variant multipliers (e.g., “chroma”, “high quality”, etc.)
- Type:
Dict[str, Any]
- class dankmemer.routes.locations.LocationsFilter(id=None, name=None, imageURL=None, bannerURL=None, disabled=None, temporary=None, limit=None)[source]
Filter for /locations data.
- You can filter on:
id: (str) exact match.
name: (StringFilterType) string matching (exact, fuzzy using Fuzzy, or membership using IN).
imageURL: (StringFilterType) matching on the location’s image URL.
bannerURL: (StringFilterType) filtering applied to extra.bannerURL.
disabled: (BooleanType) filter by the ‘disabled’ flag in extra.
temporary: (BooleanType) filter by the ‘temporary’ flag in extra.
limit: (int) maximum number of results returned.
Examples
from dankmemer import LocationsFilter, Fuzzy, IN # Exact matching. filter_exact = LocationsFilter(name="Camp Guillermo") # Fuzzy matching. filter_fuzzy = LocationsFilter(name=Fuzzy("camp", cutoff=80)) # Membership matching. filter_in = LocationsFilter(name=IN("ocean")) # Boolean filtering. filter_disabled = LocationsFilter(disabled=True)
- class dankmemer.routes.locations.LocationsRoute(client, cache_ttl)[source]
Represents the /locations endpoint, converting raw API data into Location objects and providing route-specific filtering.
- async iter_query(locations_filter=None)[source]
Asynchronously iterates over Location objects from the /locations endpoint.
If a LocationsFilter is provided, only locations matching the criteria are yielded.
- Parameters:
locations_filter (
Optional[LocationsFilter]) – Optional LocationsFilter instance for filtering.- Yield:
Each Location object from the query results.
- Return type:
AsyncIterator[Location]
- async query(locations_filter=None)[source]
Retrieve the list of Location objects from the /locations endpoint.
If a LocationsFilter is provided, only locations matching the criteria are returned.
- Parameters:
locations_filter (
Optional[LocationsFilter]) – Optional LocationsFilter instance with filtering criteria.- Return type:
List[Location]- Returns:
A list of Location objects.
Seasons Route and Filter
- class dankmemer.routes.seasons.Season(id, name, imageURL, extra)[source]
Represents a season event (or season pass) from the DankAlert API.
- id
The unique identifier of the season.
- Type:
str
- name
The display name of the season.
- Type:
str
- imageURL
The URL pointing to the season’s image.
- Type:
str
- extra
A dictionary of additional season data. This typically includes: - active (bool): Whether the season event is currently active. - freeRewards (List[Dict[str, Any]]): List of free rewards. - premiumRewards (List[Dict[str, Any]]): List of premium rewards.
- Type:
DotDict
- class dankmemer.routes.seasons.SeasonsFilter(id=None, name=None, active=None, limit=None)[source]
Filter for /seasons data.
- You can filter on:
id: (str) Exact match on season id.
- name: (StringFilterType) String matching on the season name (supports exact matching,
fuzzy matching using Fuzzy, or membership matching using IN).
active: (BooleanType) Filter based on the season’s active status.
limit: (int) Maximum number of results to return.
Examples
from dankmemer import SeasonsFilter, Fuzzy, IN # Exact matching on the 'name' field. filter_exact = SeasonsFilter(name="season-1-pass") # Fuzzy matching on the 'name' field. filter_fuzzy = SeasonsFilter(name=Fuzzy("pass", cutoff=70)) # Filtering based on active status. filter_active = SeasonsFilter(active=True)
- class dankmemer.routes.seasons.SeasonsRoute(client, cache_ttl)[source]
Represents the /seasons endpoint, converting raw API data into Season objects and providing route-specific filtering.
- async iter_query(season_filter=None)[source]
Asynchronously iterates over Season objects from the /seasons endpoint.
- Parameters:
season_filter (
Optional[SeasonsFilter]) – Optional SeasonsFilter instance for filtering.- Yield:
Each Season object that matches the filtering criteria.
- Return type:
AsyncIterator[Season]
- async query(season_filter=None)[source]
Retrieve the list of Season objects from the /seasons endpoint.
If a SeasonsFilter is provided, the returned list is filtered accordingly.
- Parameters:
season_filter (
Optional[SeasonsFilter]) – Optional SeasonsFilter instance containing filtering criteria.- Return type:
List[Season]- Returns:
A list of Season objects.
Skill Route and Filter
- class dankmemer.routes.skills.Skill(name, tiers)[source]
Represents a skill from the DankAlert API.
- name
The name of the skill.
- Type:
str
- tiers
The number of tiers available for the skill.
- Type:
int
- class dankmemer.routes.skills.SkillsFilter(name=None, tiers=None, limit=None)[source]
Filter for skills data.
Supports filtering by:
name: A string matching filter (exact, fuzzy via Fuzzy, or membership using IN).
tiers: A numeric filter (exact, a tuple range, or using interfaces such as Above, Below, or Range).
limit: Optionally limit the number of results returned.
- Examples:
from dankmemer import SkillsFilter, Fuzzy, IN, Above, Below, Range # Filter by exact skill name. filter_exact = SkillsFilter(name="AFK") # Fuzzy filtering for skill names. filter_fuzzy = SkillsFilter(name=Fuzzy("carto", cutoff=80)) # Membership filtering for skills containing "angler" or "hunter" filter_in = SkillsFilter(name=IN("angler", "hunter")) # Filtering by tiers: skills with more than 5 tiers. filter_tiers = SkillsFilter(tiers=Above(5))
- class dankmemer.routes.skills.SkillsRoute(client, cache_ttl)[source]
Represents the /skills endpoint, converting raw API data into Skill objects and providing filtering functionality.
- async iter_query(skill_filter=None)[source]
Asynchronously iterates over Skill objects from the /skills endpoint.
If a SkillsFilter is provided, only skills matching the filter criteria are yielded.
- Parameters:
skill_filter (
Optional[SkillsFilter]) – An optional SkillsFilter instance.- Yield:
Skill objects one by one.
- Return type:
AsyncIterator[Skill]
- async query(skill_filter=None)[source]
Retrieve a list of Skill objects from the /skills endpoint.
If a SkillsFilter is provided, only the skills matching the filter criteria are returned.
- Parameters:
skill_filter (
Optional[SkillsFilter]) – An optional SkillsFilter instance.- Return type:
List[Skill]- Returns:
A list of Skill objects.
SkillData Route and Filter
- class dankmemer.routes.skillsdata.SkillData(id, name, imageURL, extra)[source]
Represents an individual skill data entry obtained from the DankAlert API.
- id
The unique identifier for the skill.
- Type:
str
- name
The display name of the skill.
- Type:
str
- imageURL
The URL of the skill’s image.
- Type:
str
- extra
A dictionary of additional skill data. This typically includes: - category (str): The skill category (e.g. “Economy”, “Nature”, etc.). - description (str): A description of the skill’s effect. - requirements (dict): Requirements for the skill (badge and/or other skill requirements).
- Type:
DotDict
- class dankmemer.routes.skillsdata.SkillDataFilter(id=None, name=None, imageURL=None, category=None, description=None, limit=None)[source]
Filter for /skilldata entries.
- Supported filterable attributes:
id: (str) Exact match.
name: (StringFilterType) Matching on the skill’s name (exact, fuzzy using Fuzzy, or membership using IN).
imageURL: (StringFilterType) Filtering on the skill’s image URL.
category: (StringFilterType) Filtering based on extra.category.
description: (StringFilterType) Filtering based on extra.description.
limit: (int) Maximum number of results returned.
Examples
from dankmemer import SkillDataFilter, Fuzzy, IN filter_exact = SkillDataFilter(name="Haggler I") filter_fuzzy = SkillDataFilter(name=Fuzzy("haggler", cutoff=80)) filter_category = SkillDataFilter(category=IN("Economy"))
- class dankmemer.routes.skillsdata.SkillDataRoute(client, cache_ttl)[source]
Represents the /skilldata endpoint, converting raw API data into SkillData objects and providing route-specific filtering.
- async iter_query(skill_filter=None)[source]
Asynchronously iterates over SkillData objects from the /skilldata endpoint. If a SkillDataFilter is provided, only skills matching the criteria are iterated.
- Parameters:
skill_filter (
Optional[SkillDataFilter]) – Optional SkillDataFilter for filtering criteria.- Return type:
AsyncIterator[SkillData]- Returns:
An async iterator of SkillData objects.
- async query(skill_filter=None)[source]
Retrieves the list of SkillData objects from the /skilldata endpoint. If a SkillDataFilter is provided, only those skills matching the filter criteria are returned.
- Parameters:
skill_filter (
Optional[SkillDataFilter]) – Optional SkillDataFilter for filtering criteria.- Return type:
List[SkillData]- Returns:
A list of SkillData objects.
Stream Route
- class dankmemer.routes.stream.StreamData(trending_game)[source]
Represents the response from the /stream endpoint.
- trending_game
The current trending game payload.
- Type:
- class dankmemer.routes.stream.StreamRoute(client, cache_ttl)[source]
Represents the /stream endpoint, converting raw API data into StreamData.
- class dankmemer.routes.stream.TrendingGame(lastModified, name)[source]
Represents the trending game data from the /stream endpoint.
- lastModified
The last time the trending game was updated.
- Type:
datetime
- name
The current trending game name.
- Type:
str
Tanks Route and Filter
- class dankmemer.routes.tanks.Tank(id, name, imageURL, extra)[source]
Represents an individual tank (fishtank) entry obtained from the DankAlert API.
- id
The unique identifier for the tank.
- Type:
str
- name
The name of the tank.
- Type:
str
- imageURL
The URL of the tank’s image.
- Type:
str
- extra
Additional tank data (currently empty in the sample).
- Type:
DotDict
- class dankmemer.routes.tanks.TanksFilter(id=None, name=None, imageURL=None, limit=None)[source]
Filter for /tanks data.
- Supported filterable attributes:
id: (str) Exact match.
name: (StringFilterType) String matching on the tank’s name (exact, fuzzy via Fuzzy, or membership using IN).
imageURL: (StringFilterType) Filtering on the tank’s image URL.
limit: (int) Maximum number of results returned.
Examples
from dankmemer import TanksFilter, Fuzzy, IN filter_exact = TanksFilter(name="Blue") filter_fuzzy = TanksFilter(name=Fuzzy("blue", cutoff=80)) filter_in = TanksFilter(name=IN("tank"))
- class dankmemer.routes.tanks.TanksRoute(client, cache_ttl)[source]
Represents the /tanks endpoint, converting raw API data into Tank objects and providing route-specific filtering.
- async iter_query(tank_filter=None)[source]
Asynchronously iterates over Tank objects from the /tanks endpoint. If a TanksFilter is provided, only tanks matching the criteria are iterated.
- Parameters:
tank_filter (
Optional[TanksFilter]) – Optional TanksFilter instance for filtering.- Yield:
Tank objects.
- Return type:
AsyncIterator[Tank]
- async query(tank_filter=None)[source]
Retrieves a list of Tank objects from the /tanks endpoint. If a TanksFilter is provided, returns only the tanks matching the filter criteria.
- Parameters:
tank_filter (
Optional[TanksFilter]) – Optional TanksFilter instance containing filtering criteria.- Return type:
List[Tank]- Returns:
A list of Tank objects.
Tool Route and Filter
- class dankmemer.routes.tools.Tool(id, name, imageURL, extra)[source]
Represents an individual tool entry from the DankAlert API.
- id
Unique identifier for the tool.
- Type:
str
- name
Name of the tool.
- Type:
str
- imageURL
URL of the tool’s image.
- Type:
str
- extra
Additional tool data, which may include: - baits (bool): Whether the tool supports bait usage. - buffs (List[dict]): List of buffs provided by the tool. - debuffs (List[dict]): List of debuffs associated with the tool. - flavor (str): A descriptive string of the tool. - usage (int): The usage value for the tool.
- Type:
DotDict
- class dankmemer.routes.tools.ToolsFilter(id=None, name=None, imageURL=None, flavor=None, baits=None, buffs=None, debuffs=None, usage=None, limit=None)[source]
Filter for /tools data.
- Filterable attributes:
id (str): Exact match.
name (StringFilterType): Matches the tool’s name.
imageURL (StringFilterType): Matches the tool’s imageURL.
flavor (StringFilterType): Matches extra.flavor.
baits (BooleanType): Matches extra.baits.
buffs (StringFilterType): Checks if any buff in extra.buffs matches.
debuffs (StringFilterType): Checks if any debuff in extra.debuffs matches.
usage (NumericFilterType): Matches extra.usage.
limit (int): Maximum number of results.
Examples
from dankmemer import ToolsFilter, Fuzzy, IN filter_exact = ToolsFilter(name="Dynamite") filter_fuzzy = ToolsFilter(name=Fuzzy("dynamite", cutoff=80)) filter_in = ToolsFilter(name=IN("fishing"))
- class dankmemer.routes.tools.ToolsRoute(client, cache_ttl)[source]
Represents the /tools endpoint. This class converts raw API tool data into Tool objects, caches the results for a given time-to-live (TTL), and provides query and iteration methods.
- async iter_query(tools_filter=None)[source]
Asynchronously iterates over Tool objects from the /tools endpoint. If a ToolsFilter is provided, only iterates over tools matching the criteria.
- Parameters:
tools_filter (
Optional[ToolsFilter]) – Optional ToolsFilter instance for filtering.- Yield:
Tool objects.
- Return type:
AsyncIterator[Tool]
- async query(tools_filter=None)[source]
Retrieves a list of Tool objects from the /tools endpoint. If a ToolsFilter is provided, returns only the tools matching the filter criteria.
- Parameters:
tools_filter (
Optional[ToolsFilter]) – Optional ToolsFilter instance with filtering criteria.- Return type:
List[Tool]- Returns:
A list of Tool objects.
All Route and Filter
- class dankmemer.routes.all.AllFilter(baits=None, buckets=None, creatures=None, decorations=None, events=None, items=None, locations=None, npcs=None, seasons=None, skills=None, skillsdata=None, tanks=None, tools=None, limit=None)[source]
Aggregated filter for the /all endpoint.
Each attribute is optional and accepts a filter object for the corresponding route.
Examples
from dankmemer import ( AllFilter, BaitsFilter, BucketsFilter, CreaturesFilter, DecorationsFilter, EventsFilter, ItemsFilter, LocationsFilter, NPCsFilter, SeasonsFilter, SkillsFilter, SkillDataFilter, TanksFilter, ToolsFilter, Fuzzy, IN ) filter_all = AllFilter( baits=BaitsFilter(name="Deadly Bait"), buckets=BucketsFilter(name=IN("bucket")), creatures=CreaturesFilter(name=Fuzzy("ahuitzotl", cutoff=75)), decorations=DecorationsFilter(name="Alien Planet"), events=EventsFilter(name=Fuzzy("quality time", cutoff=80)), items=ItemsFilter(name="Trash"), locations=LocationsFilter(name=IN("camp")), npcs=None, # No filtering on NPCs, for example. seasons=SeasonsFilter(active=True), skills=SkillsFilter(name="AFK"), skillsdata=SkillDataFilter(category="Economy"), tanks=TanksFilter(name="Blue"), tools=ToolsFilter(name=Fuzzy("dynamite", cutoff=80)) )
- class dankmemer.routes.all.AllRoute(client, cache_ttl)[source]
Represents the /all endpoint.
This route fetches aggregated data (as a JSON object with keys matching individual routes) from the API and applies filters from an AllFilter to each section.
- async iter_query(all_filter=None)[source]
Asynchronously iterates over the aggregated data.
- Parameters:
all_filter (
Optional[AllFilter]) – Optional AllFilter instance for filtering criteria.- Yield:
Tuples where the first element is the route key and the second is the corresponding filtered list.
- Return type:
AsyncIterator[Tuple[str,Any]]
- async query(all_filter=None)[source]
Retrieves aggregated data from the /all endpoint and applies corresponding filters.
- Parameters:
all_filter (
Optional[AllFilter]) – Optional AllFilter instance containing filtering criteria for each route.- Return type:
Dict[str,Any]- Returns:
A dictionary with keys such as “baits”, “buckets”, etc., containing filtered results.