Skip to main content

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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.14.tar.gz
Algorithm Hash digest
SHA256 e6121968479ae48e9ca91782834e421c7e41733f96662204a222dc9fdb9d9b93
MD5 64dc7799ace3c9c0b73a2463c4c09be4
BLAKE2b-256 5fc2c541a82cf14e6055cf74618cdb9031582d6b86ab47b498a47739fc9ab336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for basalam_backbone_redis_cache-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc58b4f0e824a30ca7259108b7aed3b4e51c453f47c3233ac4464c7e938c497
MD5 5afcac348cf47ee192bdb43f4b7d0e22
BLAKE2b-256 887c070ffca5ae5a5d1d60e19c6bf84a8ab616b858ae7cd3507c2ef6b0e62dcc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page