Comparison
cachetools vs circular-dict vs lru-dict vs memoization
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Extensible memoizing collections and decorators
Actively maintained. Last release 1 day ago, commits in 15 of the last 26 weeks. A safe choice.
pip install cachetoolsCircularDict is a high-performance Python data structure that blends the functionality of dictionaries and circular buffers. Inheriting the usage of traditional dictionaries, it allows you to define constraints on size and memory usage. This way, the CircularDict will be always up-to-date with the last N added elements, ensuring that neither the maximum length nor the memory usage limit is exceeded. It is ideal for caching large data structures while maintaining control over memory footprint.
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install circular-dictAn Dict like LRU container.
Low maintenance activity. Last release 13 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install lru-dictA powerful caching library for Python, with TTL support and multiple algorithm options. (https://github.com/lonelyenvoy/python-memoization)
Likely abandoned. No release or commit for years (last release over 5 years ago).
pip install memoizationIn short
- circular-dict is slowing down (last release over 2 years ago): fine for existing code, risky for a new project.
- memoization looks abandoned: avoid it for new projects.
- cachetools is the most used: 299.4M downloads a month, 60× more than lru-dict.
- cachetools also has the best Pythie’s Index (87).
- cachetools is growing fastest: downloads +17% over the last month.
- Safe default for a new project: cachetools.
Side by side
| Metric | cachetools | circular-dict | lru-dict | memoization |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 87 | 18 |