anycache 2.3.1
pip install anycache
Released:
Cache any python object to file using improved pickling
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: Apache-2.0
SPDX License Expression - Author: Daniel Jakschik
- Tags cache, caching, cache file, pickle, dill
- Requires: Python >=3.8
Classifiers
- Development Status
- Programming Language
- Topic
Project description
To cache the result of a function, use the global unlimited anycache:
>>> from anycache import anycache >>> @anycache() ... def myfunc(posarg, kwarg=3): ... print(" Calcing %r + %r = %r" % (posarg, kwarg, posarg + kwarg)) ... return posarg + kwarg >>> myfunc(8, 5) Calcing 8 + 5 = 13 13 >>> myfunc(8, 5) 13
anycache caches nearly any python object. Also lambda statements. It uses Dill as backend. An improved version of pythons build-in pickle.
To preserve the result between multiple python runs, a persistent cache directory needs to be set.
>>> from anycache import anycache >>> @anycache(cachedir='/tmp/anycache.my') ... def myfunc(posarg, kwarg=3): ... return posarg + kwarg
The AnyCache object serves additional functions for cache clearing and size handling.
Installation
To install the anycache module run:
pip install anycache
If you do not have write-permissions to the python installation, try:
pip install anycache --user
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
-
License Expression: Apache-2.0
SPDX License Expression - Author: Daniel Jakschik
- Tags cache, caching, cache file, pickle, dill
- Requires: Python >=3.8
Classifiers
- Development Status
- Programming Language
- Topic
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
Built Distribution
File details
Details for the file anycache-2.3.1.tar.gz
.
File metadata
- Download URL: anycache-2.3.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 462644b1a54186edab9787dfae943bac1b735bb983bba2a9957318a6ca4ea5ec |
|
MD5 | 1fea85c8f9f37ef7a1b911e1c60a0167 |
|
BLAKE2b-256 | bc14af30ad16c5d86ee4ffbccdd10dd942dc4af6d2ec5ea3827ebbfee8a6a5f3 |
File details
Details for the file anycache-2.3.1-py3-none-any.whl
.
File metadata
- Download URL: anycache-2.3.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84e6c89a65ce1f21c5c0bd8dd0cd951bd8cb6a98236e54983df65fa4a8fdade9 |
|
MD5 | 0e2088ecec91b3bb42f1816399a3c8aa |
|
BLAKE2b-256 | 4ed246ce2b6b43100b726c8246732c3408ac60efd2aa6f70853cec83e18d1fda |