Skip to main content

ReductStore Client SDK for Python

PyPI PyPI - Downloads GitHub Workflow Status

This package provides an asynchronous HTTP client for interacting with ReductStore in Python.

Features

  • Supports the ReductStore HTTP API v1.21
  • 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:

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-2", 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-*",
                                         start="2024-01-01T10:00:00Z",
                                         stop="2024-01-01T10:00:02Z",
                                         when={"&score": {"$gt": 10}}):
            print(f"Record entry: {record.entry}")
            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 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.21
  • v1.20
  • v1.19

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reduct_py-1.21.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file reduct_py-1.21.0-py3-none-any.whl.

File metadata

  • Download URL: reduct_py-1.21.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for reduct_py-1.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6efe964903191f1a83666f09ae9a0b996bb79f0afd788671b983d61122995a43
MD5 a5ba25c37b8a07c0b6b0891f2fd14097
BLAKE2b-256 1528e0c2a6f013e7293a1aa9aa326e99c6c88878ed2b24fb297b976ccbde4489

See more details on using hashes here.

Provenance

The following attestation bundles were made for reduct_py-1.21.0-py3-none-any.whl:

Publisher: ci.yml on reductstore/reduct-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.21.0 This release

1 file

1.20.0

1 file

1.19.1

1 file

1.19.0

1 file

1.18.1

1 file

1.18.0

1 file

1.17.2

1 file

1.17.1

1 file

1.17.0

1 file

1.16.0

1 file

1.15.0

1 file

1.14.0

1 file

1.13.0

1 file

1.12.0

1 file

1.11.0

1 file

1.10.0

1 file

1.9.1

1 file

1.9.0

1 file

1.8.1

1 file

1.8.0

1 file

1.7.1

1 file

1.7.0

1 file

1.6.0

1 file

1.5.0

1 file

1.4.1

1 file

1.4.0

1 file

1.3.1

1 file

1.3.0

1 file

1.2.0

1 file

1.1.0

1 file

1.0.0

1 file

0.5.1

1 file

0.4.0

1 file

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page