Redis-extensions is a collection of custom extensions for Redis-py.
Project description
Redis-extensions is a collection of custom extensions for Redis-py.
Installation
pip install redis-extensions
Usage
In [1]: import redis_extensions as redis In [2]: r = redis.StrictRedisExtensions(host='localhost', port=6379, db=0) In [3]: r.zaddwithstamps('sorted_set', 1, 'a', 2, 'b') Out[3]: 1 In [4]: r.zrange('sorted_set', 0, 100, withscores=True) Out[4]: [('a', 11472205032192.0), ('b', 21472205032192.0)] In [5]: r.zrange('sorted_set', 0, 100, withscores=True, score_cast_func=r.rawscore) Out[5]: [('a', 1.0), ('b', 2.0)] In [6]: r.zincrbywithstamps('sorted_set', 'a') Out[6]: 0 In [7]: r.zrange('sorted_set', 0, 100, withscores=True) Out[7]: [('b', 21472205032192.0), ('a', 21472205071514.0)] In [8]: r.zrange('sorted_set', 0, 100, withscores=True, score_cast_func=r.rawscore) Out[8]: [('b', 2.0), ('a', 2.0)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redis-extensions-1.0.7.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for redis_extensions-1.0.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c426f9e1c9dc572c66fda363a4c0b4e4b7d231cfa84f8f1f1d1fd7e292a3688c |
|
MD5 | ced182e5b010e36d90cdaa9b242524dc |
|
BLAKE2b-256 | db2f8b14c537b93e0d4bab296b2d96b1b5ef27f4df89033218b6574d1fde58b9 |