Skip to main content

Small high-performance file caching tool for python.

Project description

FileCache

Small high-performance file caching tool for python. Sub table and sub database.

Can do what?

You can set cache file easily, just focus on your business.

How to use?

1. import

pip install demjson
pip install LogColorHelper-jingle1267
pip install FileCache-jingle1267
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

FileCache-jingle1267-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

FileCache_jingle1267-0.1.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page