PyLocache is a Python implementation of LRU local cache.
Project description
PyLocache
PyLocache is a Python implementation of LRU local cache.
Features
Memcache-like APIs.
Thread safe.
Expiration support.
Installation
$ pip install pylocache
virtualenv is strongly recommended.
Usage
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
0.0.3
Fixed installation bug.
0.0.2
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.
Source Distribution
PyLocache-0.0.4.tar.gz
(3.4 kB
view details)
File details
Details for the file PyLocache-0.0.4.tar.gz.
File metadata
- Download URL: PyLocache-0.0.4.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
448cc25b11a01b64ca18262772c81dad45201e4b6eb9123b96d2a2b1d59a636d
|
|
| MD5 |
ad68d673db175f8389c8e9c0d8d42dda
|
|
| BLAKE2b-256 |
d0124f3c0c250c0aed5d6f1fb7545a87e9e1e0507f8eb015bdcce7e4966107ff
|