A lightweight async wrapper for the DankAlert API.
Project description
Alpha Release Notice:
dankmemer.py is currently in alpha. At this stage, only the items and NPC routes are implemented. Future releases will include additional routes and enhanced features.
dankmemer.py is a lightweight asynchronous Python wrapper for the DankAlert API — it allows you to easily access Dank Memer-related data (such as items and NPCs) using powerful filtering and built-in caching.
🚀 Features
Built-in caching with configurable TTL
Powerful filtering with support for exact, fuzzy, membership (IN), and numeric range queries
Anti-rate-limit handling
📦 Installation
You can install the project using either of the following aliases:
pip install dankmemer
pip install dankmemer.py
💡 Basic Usage Example
Below are two examples that demonstrate filtering using the new interfaces.
Example 1: Filtering Items
# This example prints the names of items where the 'name' field contains either "melmsie" or "appl"
print(
[
e.name for e in (
await client.items.query(ItemsFilter(name=IN("melmsie", "appl")))
)
]
)
Example 2: Filtering NPCs
# This example prints the names of NPCs whose name contains the substring "chad"
print(
[
e.name for e in (
await client.npcs.query(NPCsFilter(name=IN("chad")))
)
]
)
Quick Start:
Below is a minimal example that shows how to use the client with filtering:
import asyncio
from dankmemer import DankMemerClient, ItemsFilter, NPCsFilter, Fuzzy, IN
async def main():
async with DankMemerClient() as client:
# Query all items (no filtering)
all_items = await client.items.query()
print("All items:", all_items)
# Query items with fuzzy matching on name.
filtered_items = await client.items.query(ItemsFilter(name=Fuzzy("trash", cutoff=80)))
print("Filtered items:", filtered_items)
# Query NPCs with membership filtering on name.
filtered_npcs = await client.npcs.query(NPCsFilter(name=IN("chad")))
print("Filtered NPCs:", filtered_npcs)
asyncio.run(main())
Documentation:
Full documentation is under development and will soon be available on Read the Docs at:
Feel free to test, report issues, and contribute to this alpha release!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dankmemer_py-0.2.0a1.tar.gz.
File metadata
- Download URL: dankmemer_py-0.2.0a1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4dfeb7c0c9bb13348d7754c03b322d78f67bef3801155b1118ace135ed335d3
|
|
| MD5 |
3c2735b62f93bdf46a67e99b4b42eb89
|
|
| BLAKE2b-256 |
38eb342b611f2e9963cccc74838dcc8c954ec5b02aa6b3a93b864f6c99b5c70a
|
File details
Details for the file dankmemer_py-0.2.0a1-py3-none-any.whl.
File metadata
- Download URL: dankmemer_py-0.2.0a1-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
180086257bde2bd9ff1dd491fa859a4cd9dbcc6e96c8fbb4cd81c93d57eca66f
|
|
| MD5 |
fc5751efa3fc26bc327421599a24421a
|
|
| BLAKE2b-256 |
da5f56298da6e25cdc82c02d239206fe6f7347b8c73ad3f4965b202c10db01e3
|