PyMemo: simple Python memoization library
Project description
PyMemo
Simple Python memoization library.
Installation
pip install pymemo-cache
Simple Usage
from pymemo import PyMemo
memo = PyMemo()
# Creates collections with optional expiration interval
articles_cache = memo.create_collection('articles', expiration_interval=15)
comments_cache = memo.create_collection('comments', expiration_interval=60)
articles_cache.set_item('article-1', {'id': 1, 'title': 'Article Example'}) # Any data type
articles_cache.get_item('article-1') # -> {'id': 1, 'title': 'Article Example'}
# After 15 seconds
articles_cache.get_item('article-1') # -> None
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymemo-cache-1.0.0.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for pymemo_cache-1.0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e375ac37cc6c7375c36e2c76ecd9cb3b73a2effaeb84fe3f2bce2532d8810ce |
|
MD5 | 782fc309a91fca8b10a5df774b247abe |
|
BLAKE2b-256 | add1b6fce170fabd129f6fa4079719a8e767f29aec7cc64b50deb0cf78918fae |