Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
As of redis-py 4.0.0 this library is deprecated. It's features have been merged into redis-py. Please either install it from pypy or the repo.
redistimeseries-py is a package that gives developers easy access to RedisTimeSeries module. The package extends redis-py's interface with RedisTimeSeries's API.
$ pip install redistimeseries
virtualenv -v venv
pip install poetry
poetry install
tox runs all tests as its default target. Running tox by itself will run unit tests. Ensure you have a running redis, with the module loaded.
The complete documentation of RedisTimeSeries's commands can be found at RedisTimeSeries's website.
# 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__
Since RedisTimeSeries 1.4 we've added the ability to back-fill time series, with different duplicate policies.
The default behavior is to block updates to the same timestamp, and you can control it via the duplicate_policy
argument. You can check in detail the duplicate policy documentation.
Bellow you can find an example of the LAST
duplicate policy, in which we override duplicate timestamps with the latest value:
from redistimeseries.client import Client
rts = Client()
rts.create('last-upsert', labels={'Time':'Series'}, duplicate_policy='last')
rts.add('last-upsert', 1, 10.0)
rts.add('last-upsert', 1, 5.0)
# should output [(1, 5.0)]
print(rts.range('last-upsert', 0, -1))
FAQs
RedisTimeSeries Python Client
We found that redistimeseries demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.