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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file FileCache-jingle1267-0.1.0.tar.gz.

File metadata

  • Download URL: FileCache-jingle1267-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for FileCache-jingle1267-0.1.0.tar.gz
Algorithm Hash digest
SHA256 637e9b1612e2c047a3671120fff400e7916b6888db43bde87e1dc53b661f7e3c
MD5 02d094b71cda718ff58ec2e4df6c093a
BLAKE2b-256 3bc2ca796c560155c07975319a45012e29d62d12f9e31eb56e67db9870548b85

See more details on using hashes here.

File details

Details for the file FileCache_jingle1267-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for FileCache_jingle1267-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb13f32b3f84da64275c76692d8e2f633f0ed21bdc061137502770bd011aef38
MD5 be04680cf5acc09636e9f7eefad32a2a
BLAKE2b-256 8da75ed83308b75452c2d7a3d1799e1a6c9fae3f198e6782c96f2e0894a8639b

See more details on using hashes here.

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