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 details)
Built Distribution
File details
Details for the file yamicache-0.7.3.tar.gz
.
File metadata
- Download URL: yamicache-0.7.3.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdf6cee10a5e71f330ff734b767f5bd0b9112607ae98f0ab3cc64c94062fd1c5 |
|
MD5 | 21a0a79cf8d7722a2337a71e44904bad |
|
BLAKE2b-256 | 857dcfaf1da85aae08906fbfac0974b5c7c62c8a57a794830c28c410d9a19609 |
File details
Details for the file yamicache-0.7.3-py3-none-any.whl
.
File metadata
- Download URL: yamicache-0.7.3-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc967f7c79550df2dfe967369059f0f9baa2a2307c3909a8d731ca19e397a5a0 |
|
MD5 | 5421430200f3bbfd497e99ef8d3afb4b |
|
BLAKE2b-256 | 0ec2af2dd42908dd62997bf3300a9d78eb3c7253284b47089a8f8bd758a36119 |