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.0.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for yamicache-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 298c74d5aee6b33077658d5d01b2dc7b811a13cc4d464032a4c1b19793a6faed |
|
MD5 | 0e2e670e1e8bbfcb92ccddf963b17fca |
|
BLAKE2b-256 | dfc9213259860bcaae034e202af7e6806d298d8a0846beace1bc5590dfcea96b |