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.10.tar.gz (2.8 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.10-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.10.tar.gz
Algorithm Hash digest
SHA256 14d237e715f06a1032af2e51e9fe45ee10b5aec04e87a6b05be82e13947812bd
MD5 4389635ee11c209bf0a8791b21436fd5
BLAKE2b-256 febe5ac9a56238cb28caed5d8fc6dc4e58d2dc4d13aa4e349497927a90f582c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basalam.backbone_redis_cache-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5c503a1d29bacb9585e4ee243b2623ebf503894ef3d1c9dd32a5f99bcbf7fe1b
MD5 89b5143aafcd7777b9de779cad9783c1
BLAKE2b-256 1a9b47fab258168b7a0ca4de54b964de0460aae5abf783f662fe15bde476c5fc

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