RedisTimeSeries Python Client
Project description
redistimeseries-py
redistimeseries-py is a package that gives developers easy access to RedisTimeSeries module. The package extends redis-py's interface with RedisTimeSeries's API.
Installation
$ pip install redistimeseries
API
The complete documentation of RedisTimeSeries's commands can be found at RedisTimeSeries's website.
Usage example
# Simple example
from redistimeseries.client import Client
rts = Client()
rts.create('test', labels={'Time':'Series'})
rts.add('test', 1, 1.12)
rts.add('test', 2, 1.12)
rts.get('test')
rts.incrby('test',1)
rts.range('test', 0, -1)
rts.range('test', 0, -1, aggregation_type='avg', bucket_size_msec=10)
rts.range('test', 0, -1, aggregation_type='sum', bucket_size_msec=10)
rts.info('test').__dict__
# Example with rules
rts.create('source', retention_msecs=40)
rts.create('sumRule')
rts.create('avgRule')
rts.createrule('source', 'sumRule', 'sum', 20)
rts.createrule('source', 'avgRule', 'avg', 15)
rts.add('source', '*', 1)
rts.add('source', '*', 2)
rts.add('source', '*', 3)
rts.get('sumRule')
rts.get('avgRule')
rts.info('sumRule').__dict__
License
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
redistimeseries-1.4.3.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for redistimeseries-1.4.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6a828acbdf440ca66caf8ac0193ed122bd5a2e0e936bb9989ccabefb3e5b509 |
|
MD5 | 0e7c118d77a113ce37ceba72d5a45a84 |
|
BLAKE2b-256 | edeead7e296c66fab7713360baf3a8e91d4fd56696d96411c6029e006d04b0f7 |