mongo-memoize
A Python decorator library for instantly caching function results in MongoDB.
Basic Usage
from mongo_memoize import memoize
@memoize()
def func():
...
Customization
You can specify custom serializer and key_generator. serializer is used to serialize function results in order to convert them into formats that can be stored in MongoDB. key_generator generates a cache key from the function arguments. PickleSerializer and PickleMD5KeyGenerator are used by default.
from mongo_memoize import memoize, NoopSerializer, PickleMD5KeyGenerator
@memoize(serializer=NoopSerializer(), key_generator=PickleMD5KeyGenerator())
def func():
...
Using Capped Collection
Capped collection is a MongoDB feature which allows to limit the maximum size of the collection. By setting capped=True, a capped collection is created automatically.
from mongo_memoize import memoize
@memoize(capped=True, capped_size=100000000)
def func():
...
Documentation
Metadata
Release files for mongo-memoize 0.0.4
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 |
|---|---|---|---|---|
| mongo-memoize-0.0.4.tar.gz | 4.3 kB | Without provenance | Details for mongo-memoize-0.0.4.tar.gz |
Release files / mongo-memoize-0.0.4.tar.gz
| Download URL | mongo-memoize-0.0.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1500e25f2ca54be0fae5f3631db7ce3be0e92daa3e66d665dbe8b4c316b8130
|
|
BLAKE2b-256 checksum How to use checksums |
9ccfd1a17858125f66ccce612c94bdfc8a41d118d676b3197e004cc8f318738b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for mongo-memoize 0.0.4
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.