Skip to main content

mezmorize

travis

versions pypi

license

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 cache dir 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)

Source distribution for mezmorize 0.31.0
File Size Uploaded
mezmorize-0.31.0.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mezmorize 0.31.0
File Interpreter ABI Platform
mezmorize-0.31.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

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

Release history Release notifications | RSS feed

This release

0.31.0 This release

2 release files

0.30.0

2 release files

0.29.1

2 release files

0.25.0

2 release files

0.24.2

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.16.1

1 release file

0.16.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page