Skip to main content

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:

https://dankmemer-py.readthedocs.io

Feel free to test, report issues, and contribute to this alpha release!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dankmemer_py-0.1.0a2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dankmemer_py-0.1.0a2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

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

Hashes for dankmemer_py-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 c3b00d5b3190b27c750ea320676dd0d20781649254a0d87097b6586fb46a1662
MD5 e527328639099b709b0d19ca91c17074
BLAKE2b-256 9a6f47495f2b2ffd1dbc74c61aa534b2c6670e51de9bd889d3921d53002715a9

See more details on using hashes here.

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

Hashes for dankmemer_py-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 9eb9ef0666c882996cf80c02c8e22efae7a6b46c527f9dd0e63f8bb492f5d47d
MD5 a8c790fa915518930da552e96b4933e6
BLAKE2b-256 d52215674487ebcbc844384fc6da0427c8cafb6a44609ddf3fb246b75600c5ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page