Small high-performance file caching tool for python.
Project description
FileCache-jingle1267
Small high-performance file caching tool for python.
Can do what?
You can set cache file easily, just focus on your business.
How to use?
1. import
from FileCache import FileCache
2. USE
FileCache.easy_cache('test_cache_file.json', 'cache_key', test_hit_callback, test_miss_callback, a=1, b='c')
各个参数的含义:
# 快速缓存便利工具
# file_name: 缓存文件名称
# cache_key:缓存字段名
# hit_callback:命中缓存需要执行的回调
# miss_callback:没有命中缓存需要执行的回调
# kwargs:回调需要传的参数
def easy_cache(file_name, cache_key, hit_callback, miss_callback, **kwargs)
3. Config(Optional)
3.1 Set cache folder path
FileCache.CACHE_DIR = './tests'
3.2 Set cache file sections
FileCache.CACHE_FILE_SECTION_COUNT = 2
Better performance can be achieved by properly setting sections count.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file FileCache-jingle1267-0.0.4.tar.gz
.
File metadata
- Download URL: FileCache-jingle1267-0.0.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f0eb6ac6dd23a9d7afe7ab6fafb8d898cc668469b89655fbb6d2f78ce64ba0 |
|
MD5 | 2203fedfa9074a635fba00c489ece021 |
|
BLAKE2b-256 | 4272210d5c40e6395d837d24a27db5d0ff93b60e4c5e873931af8383cc55143f |
File details
Details for the file FileCache_jingle1267-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: FileCache_jingle1267-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fbdf2a0159a6dabc161172acd76971595210a17a5cec455534deb4b30adea85 |
|
MD5 | c039633b6bc252cf47533b600537e796 |
|
BLAKE2b-256 | af2a604a63ea507d37372f3cd130c2480c0fabb59783399caee79e581791d40b |