Skip to main content

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

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

basalam_backbone_redis_cache-0.0.8.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basalam.backbone_redis_cache-0.0.8-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file basalam_backbone_redis_cache-0.0.8.tar.gz.

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.8.tar.gz
Algorithm Hash digest
SHA256 eed03e49aa2ea1ba1f15f2bb7c73446bc785ea4d27347c98811e511dd94f8d93
MD5 4a1f7c3c92aaad5128a683acef7d0408
BLAKE2b-256 7af1711c1cb00b05f08a957f13a597b80be509256981738d894a3b58c8344a00

See more details on using hashes here.

File details

Details for the file basalam.backbone_redis_cache-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for basalam.backbone_redis_cache-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd61fbcfad675aa6c11b74f8dae4e88e21df50c90eeb31ecc20bc934e23e4ac
MD5 1853d38420a793f1ebe826516fe55aa8
BLAKE2b-256 9700daabeed22657ddba002037fb406eb5dcbe70fdda93d6bf1ea0ba14675d9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page