Skip to main content

Python dictionary with key expiry time

OrderedTTLDict - behaves like an ordered dict you know. The methods items and values return a list of objects after purging expired objects. The method keys returns odict_keys as the parnet class, but it does so after purging expired keys. Python’s own OrderedDict and other dictionaries return a [dictionary views][1] whereas the methods here do not.

Testing

Use pytest to run the tests:

` make test `

Credits and Thanks:

and for Jyrki Muukkonen for ttldict published in https://github.com/jvtm/ttldict.

This library contains fixes for his TTLDict class and my own OrderedTTLDict.

Without all those this work would not have been possible.

[1]: https://docs.python.org/3/library/stdtypes.html#dictionary-view-objects

Metadata

Release files for ttldict 0.3.0

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

Source distribution (sdist)

Source distribution for ttldict 0.3.0
File Size Uploaded Provenance Actions
ttldict-0.3.0.tar.gz 2.7 kB Without provenance Details for ttldict-0.3.0.tar.gz

Release files / ttldict-0.3.0.tar.gz

Download URL ttldict-0.3.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
63ade5da93e4f29fd772a6fdb6c7dff0df4cd8cc8ed9477e439c31de13bab268
BLAKE2b-256 checksum
How to use checksums
daa8e656d53e28be78aba2431d31ee2087b0275d0574c7c4348bbbd3f08b55ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ttldict 0.3.0

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