expiringdict
Dictionary with auto-expiring values for caching purposes
Decision gist · record as of 2026-08-14
Yes, if you need a simple, lightweight in-memory cache with automatic expiration and can tolerate the abandoned status. The library is stable and has no known vulnerabilities, but you should not expect bug fixes or new features. Consider alternatives if you need active maintenance, thread-safety guarantees beyond basic locking, or support for newer Python versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is straightforward with no compiled dependencies.
- However, the package is abandoned—last release was 1515 days ago with no recent maintenance activity, so expect no bug fixes or updates.
License · maintenance · safety
Apache 2 (permissive) — Licensed under Apache 2 (permissive), so you can use it freely in commercial and open-source projects without restrictive obligations.
last release 2022-06-21 (1515 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 10,875,172 downloads/mo, #1,429 on PyPI
Alternatives
Verify before relying
pip install expiringdict
from expiringdict import ExpiringDict
cache = ExpiringDict(max_len=100, max_age_seconds=10)
cache["key"] = "value"
print(cache.get("key"))- Thread-safety guarantees during concurrent access beyond the stated locking during cleanup.
- Performance characteristics with large capacity or high expiration rates.
- Compatibility with Python versions beyond 3.6 given the abandoned status.
What it is and what it does
ExpiringDict is a Python caching library that wraps a dictionary with automatic value expiration and capacity limits. It stores key-value pairs that are removed either when their time-to-live (max_age_seconds) expires or when the dictionary reaches its maximum size (max_len), at which point the oldest entries are deleted. Expiration is checked on any access to the dictionary, and the object is locked during cleanup to prevent concurrent modification issues.
The package is useful for scenarios where you need a simple, in-memory cache with automatic cleanup. It supports initialization from regular dicts or other ExpiringDict instances, and can be pickled. Note that iteration over the dictionary and the keys() method do not trigger expiration of stale values—only direct access does.
Use it for
- Caching API responses or database query results with automatic expiration after a set time.
- Rate-limiting or throttling by tracking request counts that decay over time.
- Session storage in web applications where sessions expire after inactivity.
- Temporary storage of computed results that should be refreshed periodically.
- Deduplication of recent events or messages with automatic cleanup.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a simple, lightweight in-memory cache with automatic expiration and can tolerate the abandoned status.
The library is stable and has no known vulnerabilities, but you should not expect bug fixes or new features. Consider alternatives if you need active maintenance, thread-safety guarantees beyond basic locking, or support for newer Python versions.
Install
expiringdict on PyPI
Before you install
Installation is straightforward with no compiled dependencies. However, the package is abandoned—last release was 1515 days ago with no recent maintenance activity, so expect no bug fixes or updates.
License in practice
Licensed under Apache 2 (permissive), so you can use it freely in commercial and open-source projects without restrictive obligations.
Quickstart
pip install expiringdict
from expiringdict import ExpiringDict
cache = ExpiringDict(max_len=100, max_age_seconds=10)
cache["key"] = "value"
print(cache.get("key"))
Verify before relying
- Thread-safety guarantees during concurrent access beyond the stated locking during cleanup.
- Performance characteristics with large capacity or high expiration rates.
- Compatibility with Python versions beyond 3.6 given the abandoned status.
Package facts
| License | Apache 2 permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping |
| Maintenance | Abandoned 1,515 days since the last release |
| First released | |
| Downloads | 10,875,172 / month, #1,429 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.6Topic :: Software Development :: Libraries |
Evidence: expiringdict-1.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “expiring cache dictionary”
- expiringdictExpiringDict is an ordered dictionary that automatically removes…
- expiring-dictExpiringDict is a Python dictionary that automatically removes keys…
- cachetoolsProvides memoizing collections and function decorators for caching…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also circular-dict · expiring-dict · cacheout · cache-to-disk · asyncache · memoization · onecache · requests-cache · cachier · django-session-timeout