mezmorize
A python function memoization library heavily inspired by Flask-Cache.
This is a fork of the Flask-Cache extension.
Setup
mezmorize is available on PyPI and can be installed with:
pip install mezmorize
Usage
from random import randrange
from mezmorize import Cache
cache = Cache(CACHE_TYPE='simple')
@cache.memoize(60)
def add(a, b):
return a + b + randrange(0, 1000)
# Initial
add(2, 5)
# Memoized
add(2, 5)
add(2, 5)
# Delete cache
cache.delete_memoized(add)
# Initial
add(2, 5)
For more configuration options, check out the the examples or Flask-Caching documentation.
Compatibility with Flask-Cache and Flask-Caching
There are no known incompatibilities or breaking changes between either the latest Flask-Cache v0.13 or Flask-Caching v1.8.0 and the current version of mezmorize.
Python versions
Starting with version 0.26.0, mezmorize dropped Python 2 support. The library is tested against Python 3.11, 3.12, 3.13, and PyPy 3.10.
Environment Variables
- CACHE_DIR: the directory your cache will be stored in. The default is the
cachedir in the current folder.
Links
Metadata
Release files for mezmorize 0.31.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mezmorize-0.31.0.tar.gz | 20.6 kB | Without provenance | Details for mezmorize-0.31.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mezmorize-0.31.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for mezmorize-0.31.0-py2.py3-none-any.whl |
Total release size: 37.3 kB
Release files / mezmorize-0.31.0.tar.gz
| Download URL | mezmorize-0.31.0.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d5e1f1526e0f4c3caf874060825f03cc1e46b970461bf3fc7f56b7b664e743c
|
|
BLAKE2b-256 checksum How to use checksums |
48b872483838b426ab7deede3e2487674965a5561dc1c72c090914d56a330154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/2.5.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.10
|
Release files / mezmorize-0.31.0-py2.py3-none-any.whl
| Download URL | mezmorize-0.31.0-py2.py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
80ef9d0c8aa2fd9405c4b3bffd246e735dce0a2aec8a629a8ea826d5821f71c6
|
|
BLAKE2b-256 checksum How to use checksums |
ae8cede1eb9e2c2b975bc92544e752ae9b1e699fe64b4a91bb7560f40c0c7389
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/2.5.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.10
|
Security for mezmorize 0.31.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.