Requirements
- Python 3.6+
Installation & Upgrade
pip install backbone-redis-cache
Usage
from basalam.backbone_redis_cache import RedisCache
from redis.asyncio import Redis
cache = RedisCache(
connection=Redis(host="127.0.0.1", port=6379),
prefix="ORDER_CACHE."
)
await cache.set("key", "value", seconds=10 * 60)
await cache.get("key", default="Nevermind")
await cache.mset({'key1': "value1",'key2': "value2"}, seconds=15 * 60)
await cache.mget(["key1", "key2"], default="Whatever")
# Counter Manipulation
await cache.cset("key", 1, seconds=60)
await cache.cget("key")
await cache.exists("key")
await cache.forget("key")
await cache.flush()
Testing
# install pytest
pip install pytest
# run tests
python -m pytest
Changelog
- 0.0.3 Now build and push are done using gitlab-ci
- 0.0.5 set & get a counter thanks to abdi.zbn@gmail.com
- 0.0.10 added scan method thanks to ali.alimohammadi@basalam.com
Metadata
Release files for basalam.backbone-redis-cache 0.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| basalam_backbone_redis_cache-0.0.15.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| basalam_backbone_redis_cache-0.0.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / basalam_backbone_redis_cache-0.0.15.tar.gz
| Download URL | basalam_backbone_redis_cache-0.0.15.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e86b2d96ab1f4f47f2ae4a52c73c9e9d60743aeb775a1c7db91bc044170d9a24
|
|
BLAKE2b-256 checksum How to use checksums |
791633328ec5e462600c44aa207c6ad8811295e4de943212f04dad2ec0d8b97b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / basalam_backbone_redis_cache-0.0.15-py3-none-any.whl
| Download URL | basalam_backbone_redis_cache-0.0.15-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6870ab90038364e709f90451ff4d64fd515c318a06efae40da30c1d167f51ee
|
|
BLAKE2b-256 checksum How to use checksums |
6d60dd1314437ef945871950bb8bc89e04cddcef1d305b89ddcf15a87cf1b41b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|