Build Status PyPI - Python Version PyPI - License Codecov branch
sponge
An elegant cache library for python
How to use
Install
pip install sponge
Usage
from sponge import CacheManager
# config cache manager
manager = CacheManager({
'default': 'redis',
'redis': {
'host': 'localhost',
'port': 3306,
'db': 0
},
'memory': {}
})
# get cache instance
cache = manager.store('redis')
# set cache
cache.put('mykey', 'myvalue', 30) # 30 seconds
cache.get('mykey') # myvalue
# remove cache
cache.forget('mykey')
# cache fover
cache.fover('mykey', 1)
# increase
cache.increase('mykey') # the value will be 2
# decrease
cache.decrease('mykey', 2) # the value will be -1
# clear all
cache.flush()
TODO
[ ] Support cache events
[ ] Support file driver
[ ] Support database driver
[ ] Added into awesome-python
Metadata
Release files for sponge 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sponge-0.0.8.tar.gz | 18.2 kB | Without provenance | Details for sponge-0.0.8.tar.gz |
Release files / sponge-0.0.8.tar.gz
| Download URL | sponge-0.0.8.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdeb5f4fb855d4c67a78f50b4c25beebf8967fb9a85408c5f1c6165cafececf9
|
|
BLAKE2b-256 checksum How to use checksums |
ed5bc86fcb7e9d4bfe38d3ec878b62f2fe617e3c676254117cff24d5be45a694
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.5
|
Security for sponge 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.