Yet another in-memory caching package
Project description
yamicache
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
History
0.3.0 (2017-09-05)
Added @clear_cache() decorator
Added imports to allow for from yamicache import Cache
0.2.0 (2017-09-03)
Added cache key collision checking
0.1.1 (2017-09-01)
Fix #1: Cache.cached() ignores timeout parameter
0.1.0 (2017-08-28)
First release on PyPI.
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.3.0.tar.gz
(20.5 kB
view hashes)
Built Distribution
Close
Hashes for yamicache-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e74ef9eb93917f23c3e5ff39e1dbb61b2ec4ec29bba46ca7c4961cc35b0c1e |
|
MD5 | aab3cb5eff41421f9a12db6b9446fe30 |
|
BLAKE2b-256 | 63213450f2ca25c238af7a22caf7acf8049252c53779e5a42da01dd8fe5bb502 |