DEV Community

Cover image for Reduct Storage Python SDK v0.4.0 has been released
Alexey Timin for ReductStore

Posted on

2 2

Reduct Storage Python SDK v0.4.0 has been released

This is a little update from the Reduct Storage project. Today, we have released Reduct Storage Client SDK for Python v0.4.0.

Now the SDK supports Reduct Storage HTTP API v0.7, so you can get records for a time interval (or all records in an entry) as asynchronous iterator:

import asyncio
from reduct import Client, Bucket


async def main():
    client = Client('https://play.reduct-storage.dev', api_token="reduct")
    bucket: Bucket = await client.create_bucket("my-bucket", exist_ok=True)
    # Query all data in entry
    async for record in bucket.query("entry-1"):
        print(f"Time={record.timestamp}, Size={record.size} bytes")
        print("Content: ", await record.read_all())


loop = asyncio.new_event_loop()
loop.run_until_complete(main())
Enter fullscreen mode Exit fullscreen mode

Don't forget to update your pip package ;)

pip install -U reduct-py
Enter fullscreen mode Exit fullscreen mode

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more