No project description provided
Project description
CACHE GUIOSOFT
Caching data using files, Redis or local SQLite
[]
Local files for caching
from cache_gs import CacheGS
# Storage on local directory
file_cache = CacheGS('path://directory_for_cache_storage')
# Storage on local SQLite database
slite_cache = CacheGS('sqlite://directory_or_file_for_storage')
# Storage on Redis
redis_cache = CacheGS('redis://host:6379?arg=value&arg2=value2')
Usage
Like INI files, data is grouped in section/key names.
Writing value
cache.set_value(section, key, value, valid_until: int = 0, expires_in: int = 0)
# valid_until is a real timestamp
# expires_in is the life time of value in seconds from the time is created
Reading value
value = cache.get_value(section, key, default=None)
Deleting value
cache.delete_value(section, key)
Force purging expired data
cache.purge_expired()
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
cache-guiosoft-0.0.3.tar.gz
(11.7 kB
view hashes)
Built Distribution
Close
Hashes for cache_guiosoft-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b17df32367048fe4c6adb191d0377eca9381896af6b6b246a04c469e5073932 |
|
MD5 | 7eabe196037a2d8036a2a8ed6dada072 |
|
BLAKE2b-256 | f859b5e77b9b562e88f66261971eb28c7c2ff9da200f9df0eb0d958c36034564 |