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.3.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for yamicache-0.7.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc967f7c79550df2dfe967369059f0f9baa2a2307c3909a8d731ca19e397a5a0 |
|
MD5 | 5421430200f3bbfd497e99ef8d3afb4b |
|
BLAKE2b-256 | 0ec2af2dd42908dd62997bf3300a9d78eb3c7253284b47089a8f8bd758a36119 |