Yet another in-memory caching package
Project description
Yet another in-memory caching package
Free software: MIT license
Documentation: https://yamicache.readthedocs.io.
Features
Memoization
Selective caching based on decorators
Mutli-threaded support
Optional garbage collection thread
Optional time-based cache expiration
Quick Start
from __future__ import print_function
import time
from yamicache import Cache
c = Cache()
class MyApp(object):
@c.cached()
def long_op(self):
time.sleep(30)
return 1
app = MyApp()
t_start = time.time()
assert app.long_op() == 1 # takes 30s
assert app.long_op() == 1 # takes 0s
assert app.long_op() == 1 # takes 0s
assert 1 < (time.time() - t_start) < 31
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
yamicache-0.7.2.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for yamicache-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13fb7f0359e0ab3854954f4a062aebae9d9a00842fff8e1e43e380e11ba38ed |
|
MD5 | 0b6494a8fa745a9f8daa31bb2afd5894 |
|
BLAKE2b-256 | 3cbf0ad758fb5fd6148c71c5d6192a76a12a9f12503542e814b21c081db55468 |