{"id":13473938,"url":"https://github.com/RedisTimeSeries/redistimeseries-py","last_synced_at":"2025-03-26T19:35:00.819Z","repository":{"id":34295223,"uuid":"166835563","full_name":"RedisTimeSeries/redistimeseries-py","owner":"RedisTimeSeries","description":"RedisTimeSeries python client","archived":true,"fork":false,"pushed_at":"2022-12-08T08:51:35.000Z","size":130,"stargazers_count":99,"open_issues_count":14,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-17T11:47:19.420Z","etag":null,"topics":["python","redis","redis-client","timeseries"],"latest_commit_sha":null,"homepage":"https://redistimeseries.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedisTimeSeries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-21T15:21:12.000Z","updated_at":"2024-08-12T19:45:05.000Z","dependencies_parsed_at":"2023-01-15T06:00:18.572Z","dependency_job_id":null,"html_url":"https://github.com/RedisTimeSeries/redistimeseries-py","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2Fredistimeseries-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2Fredistimeseries-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2Fredistimeseries-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedisTimeSeries%2Fredistimeseries-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedisTimeSeries","download_url":"https://codeload.github.com/RedisTimeSeries/redistimeseries-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245723024,"owners_count":20661869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","redis","redis-client","timeseries"],"created_at":"2024-07-31T16:01:08.175Z","updated_at":"2025-03-26T19:34:58.941Z","avatar_url":"https://github.com/RedisTimeSeries.png","language":"Python","readme":"[![license](https://img.shields.io/github/license/RedisTimeSeries/redistimeseries-py.svg)](https://github.com/RedisTimeSeries/redistimeseries-py)\n[![PyPI version](https://badge.fury.io/py/redistimeseries.svg)](https://badge.fury.io/py/redistimeseries)\n[![CircleCI](https://circleci.com/gh/RedisTimeSeries/redistimeseries-py/tree/master.svg?style=svg)](https://circleci.com/gh/RedisTimeSeries/redistimeseries-py/tree/master)\n[![GitHub issues](https://img.shields.io/github/release/RedisTimeSeries/redistimeseries-py.svg)](https://github.com/RedisTimeSeries/redistimeseries-py/releases/latest)\n[![Codecov](https://codecov.io/gh/RedisTimeSeries/redistimeseries-py/branch/master/graph/badge.svg)](https://codecov.io/gh/RedisTimeSeries/redistimeseries-py)\n[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/RedisTimeSeries/redistimeseries-py.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/RedisTimeSeries/redistimeseries-py/context:python)\n[![Known Vulnerabilities](https://snyk.io/test/github/RedisTimeSeries/redistimeseries-py/badge.svg?targetFile=pyproject.toml)](https://snyk.io/test/github/RedisTimeSeries/redistimeseries-py?targetFile=pyproject.toml)\n\n# redistimeseries-py\n[![Forum](https://img.shields.io/badge/Forum-RedisTimeSeries-blue)](https://forum.redislabs.com/c/modules/redistimeseries)\n[![Discord](https://img.shields.io/discord/697882427875393627?style=flat-square)](https://discord.gg/KExRgMb)\n\n## Deprecation notice\n\nAs of [redis-py 4.0.0](https://pypi.org/project/redis/) this library is deprecated. It's features have been merged into redis-py. Please either install it [from pypy](https://pypi.org/project/redis) or [the repo](https://github.com/redis/redis-py).\n\n--------------------------------\n\nredistimeseries-py is a package that gives developers easy access to RedisTimeSeries module. The package extends [redis-py](https://github.com/andymccurdy/redis-py)'s interface with RedisTimeSeries's API.\n\n## Installation\n```\n$ pip install redistimeseries\n```\n\n## Development\n\n1. Create a virtualenv to manage your python dependencies, and ensure it's active.\n   ```virtualenv -v venv```\n2. Install [pypoetry](https://python-poetry.org/) to manage your dependencies.\n   ```pip install poetry```\n3. Install dependencies.\n   ```poetry install```\n\n[tox](https://tox.readthedocs.io/en/latest/) 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.\n\n\n\n## API\nThe complete documentation of RedisTimeSeries's commands can be found at [RedisTimeSeries's website](http://redistimeseries.io/).\n\n## Usage example\n\n```python\n# Simple example\nfrom redistimeseries.client import Client\nrts = Client()\nrts.create('test', labels={'Time':'Series'})\nrts.add('test', 1, 1.12)\nrts.add('test', 2, 1.12)\nrts.get('test')\nrts.incrby('test',1)\nrts.range('test', 0, -1)\nrts.range('test', 0, -1, aggregation_type='avg', bucket_size_msec=10)\nrts.range('test', 0, -1, aggregation_type='sum', bucket_size_msec=10)\nrts.info('test').__dict__\n\n# Example with rules\nrts.create('source', retention_msecs=40)\nrts.create('sumRule')\nrts.create('avgRule')\nrts.createrule('source', 'sumRule', 'sum', 20)\nrts.createrule('source', 'avgRule', 'avg', 15)\nrts.add('source', '*', 1)\nrts.add('source', '*', 2)\nrts.add('source', '*', 3)\nrts.get('sumRule')\nrts.get('avgRule')\nrts.info('sumRule').__dict__\n```\n\n## Further notes on back-filling time series\n\nSince [RedisTimeSeries 1.4](https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.4.5) we've added the ability to back-fill time series, with different duplicate policies.\n\nThe 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](https://oss.redislabs.com/redistimeseries/configuration/#duplicate_policy).\n\nBellow you can find an example of the `LAST` duplicate policy, in which we override duplicate timestamps with the latest value:\n\n```python\nfrom redistimeseries.client import Client\nrts = Client()\nrts.create('last-upsert', labels={'Time':'Series'}, duplicate_policy='last')\nrts.add('last-upsert', 1, 10.0)\nrts.add('last-upsert', 1, 5.0)\n# should output [(1, 5.0)]\nprint(rts.range('last-upsert', 0, -1))\n```\n\n## License\n[BSD 3-Clause](https://github.com/ashtul/redistimeseries-py/blob/master/LICENSE)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedisTimeSeries%2Fredistimeseries-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRedisTimeSeries%2Fredistimeseries-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRedisTimeSeries%2Fredistimeseries-py/lists"}