Name | reduct-py JSON |
Version |
1.17.0
JSON |
| download |
home_page | None |
Summary | ReductStore Client SDK for Python |
upload_time | 2025-10-21 09:31:42 |
maintainer | None |
docs_url | None |
author | Ciaran Moyne |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2022 Alexey Timin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
sdk
reductstore
api client
database
time series database
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ReductStore Client SDK for Python
[](https://pypi.org/project/reduct-py/)
[](https://pypi.org/project/reduct-py/)
[](https://github.com/reductstore/reduct-py/actions)
This package provides an asynchronous HTTP client for interacting with [ReductStore](https://www.reduct.store) in Python.
## Features
* Supports the [ReductStore HTTP API v1.17](https://www.reduct.store/docs/http-api)
* Bucket management
* API Token management
* Write, read and query data
* Labeling records
* Batching records for read and write operations
* Subscription
* Replication management
## Install
To install this package, run the following command:
```
pip install reduct-py
```
## Example
Here is an example of how to use this package to create a bucket, write data to it, and read data from it:
```python
from reduct import Client, BucketSettings, QuotaType
async def main():
# 1. Create a ReductStore client
async with Client("http://localhost:8383", api_token="my-token") as client:
# 2. Get or create a bucket with 1Gb quota
bucket = await client.create_bucket(
"my-bucket",
BucketSettings(quota_type=QuotaType.FIFO, quota_size=1_000_000_000),
exist_ok=True,
)
# 3. Write some data with timestamps in the 'entry-1' entry
await bucket.write("sensor-1", b"<Blob data>",
timestamp="2024-01-01T10:00:00Z",
labels={"score": 10})
await bucket.write("sensor-1", b"<Blob data>",
timestamp="2024-01-01T10:00:01Z",
labels={"score": 20})
# 4. Query the data by time range and condition
async for record in bucket.query("sensor-1",
start="2024-01-01T10:00:00Z",
stop="2024-01-01T10:00:02Z",
when={"&score": {"$gt": 10}}):
print(f"Record timestamp: {record.timestamp}")
print(f"Record size: {record.size}")
print(await record.read_all())
# 5. Run the main function
if __name__ == "__main__":
import asyncio
asyncio.run(main())
```
For more examples, see the [Guides](https://reduct.store/docs/guides) section in the ReductStore documentation.
### Supported ReductStore Versions and Backward Compatibility
The library is backward compatible with the previous versions. However, some methods have been deprecated and will be
removed in the future releases. Please refer to **CHANGELOG.md** for more details.
The SDK supports the following ReductStore API versions:
* v1.17
* v1.16
* v1.15
It can work with newer and older versions, but it is not guaranteed that all features will work as expected because
the API may change and some features may be deprecated or the SDK may not support them yet.
Raw data
{
"_id": null,
"home_page": null,
"name": "reduct-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Alexey Timin <atimin@gmail.com>",
"keywords": "sdk, reductstore, api client, database, time series database",
"author": "Ciaran Moyne",
"author_email": "Alexey Timin <atimin@gmail.com>, Anthony Cavin <anthony@reduct.store>",
"download_url": null,
"platform": null,
"description": "# ReductStore Client SDK for Python\n\n[](https://pypi.org/project/reduct-py/)\n[](https://pypi.org/project/reduct-py/)\n[](https://github.com/reductstore/reduct-py/actions)\n\nThis package provides an asynchronous HTTP client for interacting with [ReductStore](https://www.reduct.store) in Python.\n\n## Features\n\n* Supports the [ReductStore HTTP API v1.17](https://www.reduct.store/docs/http-api)\n* Bucket management\n* API Token management\n* Write, read and query data\n* Labeling records\n* Batching records for read and write operations\n* Subscription\n* Replication management\n\n## Install\n\nTo install this package, run the following command:\n\n```\npip install reduct-py\n```\n\n## Example\n\nHere is an example of how to use this package to create a bucket, write data to it, and read data from it:\n\n```python\nfrom reduct import Client, BucketSettings, QuotaType\n\n\nasync def main():\n # 1. Create a ReductStore client\n async with Client(\"http://localhost:8383\", api_token=\"my-token\") as client:\n # 2. Get or create a bucket with 1Gb quota\n bucket = await client.create_bucket(\n \"my-bucket\",\n BucketSettings(quota_type=QuotaType.FIFO, quota_size=1_000_000_000),\n exist_ok=True,\n )\n\n # 3. Write some data with timestamps in the 'entry-1' entry\n await bucket.write(\"sensor-1\", b\"<Blob data>\",\n timestamp=\"2024-01-01T10:00:00Z\",\n labels={\"score\": 10})\n await bucket.write(\"sensor-1\", b\"<Blob data>\",\n timestamp=\"2024-01-01T10:00:01Z\",\n labels={\"score\": 20})\n\n # 4. Query the data by time range and condition\n async for record in bucket.query(\"sensor-1\",\n start=\"2024-01-01T10:00:00Z\",\n stop=\"2024-01-01T10:00:02Z\",\n when={\"&score\": {\"$gt\": 10}}):\n print(f\"Record timestamp: {record.timestamp}\")\n print(f\"Record size: {record.size}\")\n print(await record.read_all())\n\n\n# 5. Run the main function\nif __name__ == \"__main__\":\n import asyncio\n\n asyncio.run(main())\n\n```\n\nFor more examples, see the [Guides](https://reduct.store/docs/guides) section in the ReductStore documentation.\n\n\n### Supported ReductStore Versions and Backward Compatibility\n\nThe library is backward compatible with the previous versions. However, some methods have been deprecated and will be\nremoved in the future releases. Please refer to **CHANGELOG.md** for more details.\nThe SDK supports the following ReductStore API versions:\n\n* v1.17\n* v1.16\n* v1.15\n\nIt can work with newer and older versions, but it is not guaranteed that all features will work as expected because\nthe API may change and some features may be deprecated or the SDK may not support them yet.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2022 Alexey Timin\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "ReductStore Client SDK for Python",
"version": "1.17.0",
"project_urls": {
"Blog": "https://www.reduct.store/blog",
"Changelog": "https://github.com/reductstore/reduct-py/blob/main/CHANGELOG.md",
"Documentation": "https://www.reduct.store/docs",
"ReductStore": "https://www.reduct.store",
"Source": "https://github.com/reductstore/reduct-py",
"Twitter": "https://twitter.com/ReductStore"
},
"split_keywords": [
"sdk",
" reductstore",
" api client",
" database",
" time series database"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f610ee05fcc7c499aa2d77e0ec50a77034173d695963555b2f4b33f05696c4df",
"md5": "6fcf65a7a695eebed87e3a5e09577c94",
"sha256": "df30cd42dd6d71ab980f3e515f91e6216a50f3e46e03afc3e15f11fe7624a029"
},
"downloads": -1,
"filename": "reduct_py-1.17.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6fcf65a7a695eebed87e3a5e09577c94",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 20380,
"upload_time": "2025-10-21T09:31:42",
"upload_time_iso_8601": "2025-10-21T09:31:42.917993Z",
"url": "https://files.pythonhosted.org/packages/f6/10/ee05fcc7c499aa2d77e0ec50a77034173d695963555b2f4b33f05696c4df/reduct_py-1.17.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-21 09:31:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "reductstore",
"github_project": "reduct-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "reduct-py"
}