Skip to main content

dankmemer.py

Documentation

An asynchronous Python library for the official Dank Memer API.

Look up items by name, explore fishing data, check daily gifts and merchant trades, and receive events when the data changes. The library works on its own or alongside discord.py.

Installation

Python 3.11 or newer and a Dank Memer developer token are required. These examples use the official API client introduced in 1.0.0.

python -m pip install --upgrade "dankmemer.py>=1.0.0"

The same releases are available under the mirror name dankmemer. Install one of the two package names in each environment; both import as dankmemer.

For persistent event delivery, install the backend you want to use:

python -m pip install --upgrade "dankmemer.py[sqlite]>=1.0.0"
python -m pip install --upgrade "dankmemer.py[postgres]>=1.0.0"

Create your API token in the developer dashboard. The library imports as dankmemer. For Discord slash commands and item autocomplete, install "dankmemer.py[discord]>=1.0.0" with the same pip options.

Quick start

Set DANK_MEMER_API_TOKEN in your environment, then save this as launcher.py:

import asyncio
import os

from dankmemer import DankMemer


async def main() -> None:
    async with DankMemer(os.environ["DANK_MEMER_API_TOKEN"]) as dank:
        item = await dank.items.get("Life Saver")
        if item is not None:
            print(f"{item.name}: market value {item.market_value:,}")


if __name__ == "__main__":
    asyncio.run(main())

Run python launcher.py. Keep one client open for your application's lifetime; the context manager closes it when you finish. Item lookups share a catalog cached for one hour by default. Use refresh=True to request an updated value.

What you can do

  • Find items, pets, skins, commands, and fishing records by name or ID.
  • Search and filter catalogs, and resolve related records.
  • Add item-name choices to discord.py slash commands with an optional helper.
  • Read active boosts, drops, sales, fishing events, and the trending game.
  • Check daily gifts, merchant trades, and completed lottery results.
  • Browse blogs and changelogs with asynchronous pagination.
  • Subscribe to events with resource-specific polling schedules.
  • Preserve detected callbacks across restarts with SQLite, PostgreSQL, or a custom store.
  • Share polling and delivery between processes when your application needs it.

Events

Register async handlers before starting the client:

from dankmemer import DankMemer, Drop, EventConfig

dank = DankMemer(token, events=EventConfig(emit_initial=True))


@dank.event
async def on_drop_started(drop: Drop) -> None:
    print(f"Drop {drop.id} is available until {drop.ends_at}")

Start the client and keep it open to receive events. Only resources required by registered listeners are polled. Automatic attempts to the same resource remain at least 60 seconds apart.

Events describe changes observed through polling. A short-lived record can be missed if it disappears between reads; durable delivery preserves changes the library has already detected.

Documentation

The documentation includes:

  • A quick start and standalone examples.
  • Slash command autocomplete, function examples, and a Bot with commands in Cogs.
  • Every event signature, its meaning, and its polling schedule.
  • Caching, error handling, explicit startup, and persistent delivery.
  • The public client, resource, model, configuration, and storage references.

Use the official API documentation alongside the library guides. API access must follow Dank Memer's applicable rules, terms, and privacy policy.

Upgrading from rc3? Follow the migration guide and release notes.

Report problems through GitHub issues. For working on the library itself, see Contributing.

Acknowledgements

The enum design and event/listener API were inspired by discord.py. This project is independent and uses its own implementation.

License

MIT. See LICENSE.

Metadata

Release files for dankmemer.py 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dankmemer.py 1.0.1
File Size Uploaded Provenance Actions
dankmemer_py-1.0.1.tar.gz 220.8 kB Without provenance Details for dankmemer_py-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dankmemer.py 1.0.1
File Interpreter ABI Platform Actions
dankmemer_py-1.0.1-py3-none-any.whl Python 3 none any Details for dankmemer_py-1.0.1-py3-none-any.whl

Total release size: 347.3 kB

Release files / dankmemer_py-1.0.1.tar.gz

Download URL dankmemer_py-1.0.1.tar.gz
Size 220.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c1becd7cf21a26fb007964c00be4d35bbb30edd0c7fc314d88ee603e9e3f9f09
BLAKE2b-256 checksum
How to use checksums
5b1c4e01b40d8d6182f983cf110c7d43c9b18c710bf80258d007d0775a3efd76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / dankmemer_py-1.0.1-py3-none-any.whl

Download URL dankmemer_py-1.0.1-py3-none-any.whl
Size 126.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1acf3f05412c75b6f9acb72088746ab0062f3dffce616cdc57ca4716e76e72d
BLAKE2b-256 checksum
How to use checksums
0d1e5550e99e17d56b3c12d85cd1ba88bd45fb23bdb1d26f638a8c4b88722523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for dankmemer.py 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page