Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cizeero/hache
Have your function outputs cached persistently using SQLite using a simple decorator
https://github.com/cizeero/hache
cache cache-storage lru-cache sqlite
Last synced: about 8 hours ago
JSON representation
Have your function outputs cached persistently using SQLite using a simple decorator
- Host: GitHub
- URL: https://github.com/cizeero/hache
- Owner: cizeero
- Created: 2024-08-24T06:12:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T11:01:42.000Z (3 months ago)
- Last Synced: 2024-10-13T17:24:06.613Z (about 1 month ago)
- Topics: cache, cache-storage, lru-cache, sqlite
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hache: Persistent Cache Manager
Hache is a one-file library that allows you to have persistent cacheing for
function return values. We map the hash (`md5`) of the input parameters
in-order to the output value. In order to avoid bugs, any change in the
function description or the docstring will clear the function cache and start
afresh.## Example
```py
# database name that will create the file for database
DATABASE_NAME = "function.db"@hache(blob_type=np.ndarray, max_size=1000)
def multiply_matrix(a, b):
return a @ b
```### Requirements
Package requirements:
- `numpy`Development requirements:
- `pytest`