Skip to main content

ReductStore Client SDK for Python

Project description

ReductStore Client SDK for Python

PyPI PyPI - Downloads GitHub Workflow Status

This package provides an asynchronous HTTP client for interacting with the ReductStore service.

Features

  • Supports the ReductStore HTTP API v1.9
  • Bucket management
  • API Token management
  • Write, read and query data
  • Labels
  • Batching records for read and write operations
  • Subscription on new data

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 datetime import datetime
import asyncio
from reduct import Client, Bucket

async def main():
    # Create a client for interacting with a ReductStore service
    client = Client("http://localhost:8383")

    # Create a bucket and store a reference to it in the `bucket` variable
    bucket: Bucket = await client.create_bucket("my-bucket", exist_ok=True)

    # Write data to the bucket
    ts = datetime.now()
    await bucket.write("entry-1", b"Hey!!", ts)

    # Read data from the bucket
    async with bucket.read("entry-1", ts) as record:
        data = await record.read_all()
        print(data)

# Run the main function
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

For more examples, see the Quick Start.

References

Project details


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

reduct_py-1.9.1-py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page