Skip to content

Reduct Storage Client SDK for Python

PyPI PyPI - Downloads GitHub Workflow Status

Asynchronous HTTP client for Reduct Storage written in Python.

Features

Install

pip install reduct-py

Example

import time
import asyncio
from reduct import Client, Bucket


async def main():
    client = Client('https://play.reduct-storage.dev')
    bucket: Bucket = await client.create_bucket("my-bucket", exist_ok=True)

    ts = time.time_ns() / 1000
    await bucket.write("entry-1", b"Hey!!", ts)
    async with bucket.read("entry-1", ts) as record:
        data = await record.read_all()
        print(data)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

References