Skip to main content

PyLocache is a Python implementation of LRU local cache.

Project description


PyLocache is a Python implementation of LRU local cache.


  • Memcache-like APIs.
  • Thread safe.
  • Expiration support.


$ pip install pylocache

virtualenv is strongly recommended.


from pylocache import LocalCache

cache = LocalCache(max_size=5)
cache.set('foo', 1)
cache.set('bar', 2)

cache.get('foo')  # 1

cache.set('hello', 'world', expires=3)  # expires in 3 seconds.

# All items of it will be expired in 2 seconds after being set.
volatile_cache = LocalCache(max_size=5, expires=2)

Change History


  • Fixed installation bug.


  • Added delete method.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PyLocache, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size PyLocache-0.0.4.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page