Skip to main content

A tiny LRU cache implementation and decorator

Project description

repoze.lru

repoze.lru is a LRU (least recently used) cache implementation. Keys and values that are not used frequently will be evicted from the cache faster than keys and values that are used frequently. It works under Python 2.5, Python 2.6, Python 2.7, and Python 3.2.

Please see docs/index.rst for detailed documentation.

Changelog

0.6 (2012-07-12)

  • Added a ‘CacheMaker’ helper class: a maker keeps references (by name) to the caches it creates, to permit them to be cleared.

  • Added statistics to each cache, tracking lookups, hits, misses, and evictions.

  • Automated building Sphinx docs and testing example snippets under tox.

  • Added Sphinx documentation.

  • Dropped support for Python 2.5.

  • Added support for PyPy.

  • Added setup.py docs alias (installs Sphinx and dependencies).

  • Added setup.py dev alias (runs develop plus installs nose and coverage).

  • Added support for CI under supported Pythons using tox.

  • Bug: Remove potential race condition on lock in face of interrupts (Issue #10).

0.5 (2012-03-24)

  • Feature: added a new “invalidate()” method to allow removal of items from the cache (issue #8).

  • Bug: LRUCache.put() could take multiple seconds on large caches (Issue #7).

  • Bug: LRUCache was not thread safe (Issue #6).

  • Bug: LRUCache.clock would waste RAM (Issue #4).

  • Bug: repeated pushing of an entry would remove other cache entries (Issue #3).

  • Bug: LRUCache would evict entries even when not full (Issue #2).

0.4 (2011-09-04)

0.3 (2009/06/16)

  • Add a thread lock around clear logic.

0.2 (2009/06/15)

  • Add a clear method.

0.1 (2009/06/14)

  • Initial 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

repoze.lru-0.6.tar.gz (19.8 kB view details)

Uploaded Source

File details

Details for the file repoze.lru-0.6.tar.gz.

File metadata

  • Download URL: repoze.lru-0.6.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for repoze.lru-0.6.tar.gz
Algorithm Hash digest
SHA256 0f7a323bf716d3cb6cb3910cd4fccbee0b3d3793322738566ecce163b01bbd31
MD5 2c3b64b17a8e18b405f55d46173e14dd
BLAKE2b-256 6e1eaa15cc90217e086dc8769872c8778b409812ff036bf021b15795638939e4

See more details on using hashes here.

Supported by

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