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.9.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.9-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.9.tar.gz
Algorithm Hash digest
SHA256 4aa075dc88b958b290d3f1f9bda7fa683436c4a1da3494d95c59298db9f39ae0
MD5 79f216612c845dcd865ce55056e5fa53
BLAKE2b-256 3f7b9d3d35953119db72c1e490e69c772ab2681c778a7a927224bf663b045b9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basalam.backbone_redis_cache-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9e64d069ffddff55e60ca4ceaea6bbd39a11cc423de9d108dbf942961f860fc4
MD5 7fa022c33a322eff1545d60489f1b03d
BLAKE2b-256 6bf04f08a18b48e938a6d86d5e773b41832171ff36bc4ac05052ad25ee085faf

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