Note: This package is in the dangerous land of
0.x.yversions and may be subject to breaking changes with minor version increments.
nr.caching
A simple key-value API with implementations for local JSON and SQLite3 storage backends and a JSON convenience layer.
Quickstart
from nr.caching.stores.sqlite import SqliteStore
from nr.caching.adapters.json import hash_args, JsonCacheFactory
caching_backend = SqliteStore('.cache.db')
cache_factory = JsonCacheFactory(caching_backend, default_exp=60)
data = cache_factory.namespace('my-namespace').loading(
f'expensive_function_{hash_args(parameters)}',
lambda: expensive_function(*parameters))
Copyright © 2021 Niklas Rosenstein
Metadata
Release files for nr.caching 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nr.caching-0.4.1.tar.gz | 9.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nr.caching-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.0 kB
Release files / nr.caching-0.4.1.tar.gz
| Download URL | nr.caching-0.4.1.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a109b3fb5c184c135e336f37000bde7f8de890714cf8b57f7de17a65fdd43c2c
|
|
BLAKE2b-256 checksum How to use checksums |
bdb3cfd7e54c39de0db8251b1ac1fffd4487b2d0753e7e11091b4cf7ca3339ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|
Release files / nr.caching-0.4.1-py3-none-any.whl
| Download URL | nr.caching-0.4.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fe483c6fd7695c4d2d6284fb9f4d432f0c3e5ed0e02e2df31e72c7cb0748e1d
|
|
BLAKE2b-256 checksum How to use checksums |
52539dfb156911d4e74fa6b0bcf5f2b2538e835423ec91c6b09e1477f5b32fee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10
|