Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willcrichton/pickle-cache
Small utility for easily and efficiently saving/loading Python values to disk.
https://github.com/willcrichton/pickle-cache
Last synced: 23 days ago
JSON representation
Small utility for easily and efficiently saving/loading Python values to disk.
- Host: GitHub
- URL: https://github.com/willcrichton/pickle-cache
- Owner: willcrichton
- Created: 2018-12-23T00:03:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-01T18:49:47.000Z (almost 6 years ago)
- Last Synced: 2024-10-22T11:35:00.280Z (2 months ago)
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pickle-cache
Small utility for easily and efficiently saving/loading Python values to disk.
## Installation
```
pip install pickle-cache
```## Usage
```python
from pickle_cache import PickleCachepc = PickleCache()
pc.set('foo', 'bar')
assert(pc.get('foo') == 'bar')class Test:
def __init__(self, x):
self._x = xdef make_test():
return Test(1)assert(pc.get('test', make_test)._x == 1) # compute if not exists
assert(pc.get('test', make_test)._x == 1) # cache if exists
```