Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesqin-cn/tinycache
tinycache is a python modules base on local file for any python data struct
https://github.com/jamesqin-cn/tinycache
cache pip python2 python3
Last synced: 8 days ago
JSON representation
tinycache is a python modules base on local file for any python data struct
- Host: GitHub
- URL: https://github.com/jamesqin-cn/tinycache
- Owner: jamesqin-cn
- License: mit
- Created: 2020-02-13T14:17:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-15T08:26:20.000Z (almost 5 years ago)
- Last Synced: 2024-11-18T07:36:51.412Z (2 months ago)
- Topics: cache, pip, python2, python3
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tiny Cache
## What is TinyCache?
tinycache is a python modules base on local file for any python data struct## Programming Language
- python 2.7
- python 3.7## Install
```
pip install tinycache
```## Quick Start
use python decorators syntax to wrap the call target
```
from tinycache import WithCache@WithCache(5)
def Add(a, b):
return a + bclass Foo():
@WithCache(5)
def Bar(self, a, b):
return a - b
```## Cache File Format
cache file is json format, with filename look like './cache/``'
```
{
"created_at": 1581652043.872242,
"expired_at": 1581652048.872242,
"key_str": "Add(&=1&=2)",
"key": "9d0aa1c9634aa575696710c7dfb9f018",
"value": 3
}
```