Metadata-Version: 2.1
Name: nr.caching
Version: 0.3.2
Summary: A simple key-value caching API with default implementations for an SQLite3 storage backend and a JSON convenience layer.
Home-page: https://git.niklasrosenstein.com/NiklasRosenstein/nr
Author: Niklas Rosenstein
Author-email: rosensteinniklas@gmail.com
License: MIT
Platform: UNKNOWN
Requires-Python: >=3.6.0,<4.0.0
Description-Content-Type: text/markdown
Requires-Dist: overrides (<4.0.0,>=3.1.0)


> Note: This package is in the dangerous land of `0.x.y` versions and may be subject to breaking
> changes with minor version increments.

# nr.caching

A simple key-value caching API with default implementations for an SQLite3 storage backend and
a JSON convenience layer.

## Quickstart

```py
from nr.caching.sqlite import SqliteStore
from nr.caching.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))
```

---

<p align="center">Copyright &copy; 2021 Niklas Rosenstein</p>


