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.13.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.

basalam_backbone_redis_cache-0.0.13-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.13.tar.gz
Algorithm Hash digest
SHA256 2ff531058aca22e6adf9a12862a716e98eb068cdf3d16a84b22c568830268e26
MD5 ef0ee1f842b22fb1264f523cda4710f2
BLAKE2b-256 ba6a482b96de6e3d4b335085f043e85074bb4da0c69adebcbcdb74204d81df67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 c58bf5d199a9c2e1132ef1a73cc468f6227d8ce684fc52dc482af7dc33ab7f24
MD5 cd66effb665d900bc1a911ec323b9582
BLAKE2b-256 d47744bf80fd82d1bb7a8831c28cc57d5defbb468059d148c86073fd75e8bc3f

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