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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.7.tar.gz
Algorithm Hash digest
SHA256 eba5b5616e358d8aaca5eb9825d6a4f5c1134b6597fb3dc131723384c09fd60a
MD5 01c4c0ea3ac197bfb4d14262a448361b
BLAKE2b-256 fb30f73aadf631f96e9b7a12abdc7aa42b7f43aa9b8de5c3f24daa62b2552e53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basalam.backbone_redis_cache-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8c0d3562a8b7985c541d698274134fb5d743d7d45a979191c6b9564fef3cd890
MD5 121ad38e7ceb7330d7ce2980a9105282
BLAKE2b-256 43eb0c365e81191b28762978d32cd746b697bb8036642929277349105107764a

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