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.12.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.12.tar.gz
Algorithm Hash digest
SHA256 9090b6f71c32e5218a49dc3ac5132c899820cdf11e74cda7eae261aefbef1500
MD5 dcf31b2c2093efb67f736e3034d2fbc6
BLAKE2b-256 42df8f9cead5d26a10f711cf6630637c2bbd5d49da79025965b3af607a82b31f

See more details on using hashes here.

File details

Details for the file basalam_backbone_redis_cache-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6fbd9e5d84a5dc3aa4dde56a3b09f3c2d9c9d2e0317f201f0002652b2546e033
MD5 fbe0c876beed2f82828939c5f32126cc
BLAKE2b-256 efc1e3df686657e385708d3ba37cb6bfe55adc01e6be269a1cfad181934bbae0

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