A lightweight async wrapper for the DankAlert API.
Reason this release was yanked:
Incomplete package—missing "routes" folder due to missing __init__.py.
Project description
Alpha Release Notice:
dankmemer.py is currently in alpha. At this stage, only the items route is implemented. Future releases will include additional routes and enhanced features.
dankmemer.py is a simple and powerful asynchronous Python wrapper for the DankAlert API — giving you easy access to Dank Memer-related data like items, NPCs, skills, tools, and more.
🚀 Features
Built-in caching with configurable TTL
Powerful filtering with support for exact, fuzzy, and numeric range queries
📦 Installation
You can install the project using any of the following aliases:
pip install dankmemer
pip install dankmemer.py
Items Route
The Items Route provides access to the /items endpoint from the DankAlert API. It automatically caches responses for a configurable period, converts raw JSON into Item objects, and allows easy filtering via the ItemsFilter class and the Fuzzy helper.
Basic Example
import asyncio
from dankmemer import DankMemerClient, ItemsFilter, Fuzzy
async def main():
async with DankMemerClient() as client:
# Retrieve all items without filtering.
all_items = await client.items.query()
print("All items:", all_items)
# Example: Filtering items using various criteria:
# - Fuzzy matching on the 'name' field (e.g. items with names similar to "trash")
# - Boolean filtering for 'hasUse' flag
# - Numeric range filtering for 'marketValue'
filter_obj = ItemsFilter(
name=Fuzzy("trash", cutoff=80), # Fuzzy match on name with a cutoff of 80%
hasUse=False, # Only items that are not usable
marketValue=(5000, 10000000) # Market value between 5,000 and 10,000,000
)
filtered_items = await client.items.query(filter_obj)
print("Filtered items:", filtered_items)
asyncio.run(main())
This basic example demonstrates: - Exact vs. Fuzzy Matching: Use a plain string for exact matches (e.g. name="Trash") or wrap your string with the Fuzzy helper (e.g. name=Fuzzy("trash", cutoff=80)) for fuzzy matching. - Numeric Range Filtering: Supply a tuple (min, max) to filter numeric fields such as marketValue. - Boolean Filtering: Directly pass boolean values (e.g. hasUse=True).
Documentation
Full documentation for dankmemer.py can be found 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.1.0a2.tar.gz.
File metadata
- Download URL: dankmemer_py-0.1.0a2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3b00d5b3190b27c750ea320676dd0d20781649254a0d87097b6586fb46a1662
|
|
| MD5 |
e527328639099b709b0d19ca91c17074
|
|
| BLAKE2b-256 |
9a6f47495f2b2ffd1dbc74c61aa534b2c6670e51de9bd889d3921d53002715a9
|
File details
Details for the file dankmemer_py-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: dankmemer_py-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 5.8 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 |
9eb9ef0666c882996cf80c02c8e22efae7a6b46c527f9dd0e63f8bb492f5d47d
|
|
| MD5 |
a8c790fa915518930da552e96b4933e6
|
|
| BLAKE2b-256 |
d52215674487ebcbc844384fc6da0427c8cafb6a44609ddf3fb246b75600c5ec
|