Python Utilities & Basalam Micro-Services SDK
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basalam_backbone_redis_cache-0.0.13.tar.gz.
File metadata
- Download URL: basalam_backbone_redis_cache-0.0.13.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff531058aca22e6adf9a12862a716e98eb068cdf3d16a84b22c568830268e26
|
|
| MD5 |
ef0ee1f842b22fb1264f523cda4710f2
|
|
| BLAKE2b-256 |
ba6a482b96de6e3d4b335085f043e85074bb4da0c69adebcbcdb74204d81df67
|
File details
Details for the file basalam_backbone_redis_cache-0.0.13-py3-none-any.whl.
File metadata
- Download URL: basalam_backbone_redis_cache-0.0.13-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c58bf5d199a9c2e1132ef1a73cc468f6227d8ce684fc52dc482af7dc33ab7f24
|
|
| MD5 |
cd66effb665d900bc1a911ec323b9582
|
|
| BLAKE2b-256 |
d47744bf80fd82d1bb7a8831c28cc57d5defbb468059d148c86073fd75e8bc3f
|