Skip to main content

Sia Storage SDK for Python

Python bindings for Sia Storage, built with Rust and UniFFI.

Requirements

  • Python 3.9+

Installation

PyPI

pip install sia-storage

Example

import asyncio
from io import BytesIO

from sia_storage import (
    generate_recovery_phrase,
    AppMetadata,
    Builder,
    DownloadOptions,
    PinnedObject,
    UploadOptions,
)


async def main():
    app_id = b"\x01" * 32

    builder = Builder(
        "https://sia.storage",
        AppMetadata(
            id=app_id,
            name="My App",
            description="App description",
            service_url="https://myapp.com",
            logo_url=None,
            callback_url=None,
        ),
    )
    await builder.request_connection()

    # Wait for user approval
    print(f"Please approve connection {builder.response_url()}")
    await builder.wait_for_approval()

    # Register with a recovery phrase
    mnemonic = generate_recovery_phrase()
    sdk = await builder.register(mnemonic)

    # Upload a single object. Progress callbacks accept plain callables.
    def on_upload(p):
        print(f"uploaded shard {p.shard_index} of slab {p.slab_index} in {p.elapsed_ms}ms")

    obj = await sdk.upload(
        PinnedObject(),
        BytesIO(b"hello, world!"),
        UploadOptions(shard_uploaded=on_upload),
    )
    await sdk.pin_object(obj)

    # Download streams via an async context manager.
    def on_download(p):
        print(f"downloaded shard {p.shard_index} of slab {p.slab_index} in {p.elapsed_ms}ms")

    async with sdk.download(obj, DownloadOptions(shard_downloaded=on_download)) as d:
        data = await d.read_all()
    print(data)


asyncio.run(main())

A complete working example is available in examples/python/.

Local Development

cd python
python3 -m venv .venv
source .venv/bin/activate
pip3 install maturin

# Build and install the wheel
maturin develop

# Run the example
cd ../examples/python
python example.py

License

MIT License - see LICENSE for details.

Metadata

Release files for sia-storage 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sia-storage 0.12.0
File Size Uploaded
sia_storage-0.12.0.tar.gz 76.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for sia-storage 0.12.0
File
sia_storage-0.12.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
sia_storage-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
sia_storage-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
sia_storage-0.12.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
sia_storage-0.12.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 20.1 MB

Release files / sia_storage-0.12.0.tar.gz

Download URL sia_storage-0.12.0.tar.gz
Size 76.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1e2102edd0442f91751c7e468c5fb1c8c018d580b87e9247777e217e0ab3741c
BLAKE2b-256 checksum
How to use checksums
ff99eab53ad7038f2b1f7d7b8446adad0b617c050839d90e74e848cbf2fddb36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sia_storage-0.12.0-py3-none-win_amd64.whl

Download URL sia_storage-0.12.0-py3-none-win_amd64.whl
Size 3.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a1afabfbe07596193cf9adcb11d0087a048e02438dbdb9b9f2ed5bf9bb21b911
BLAKE2b-256 checksum
How to use checksums
2fd7ffbe78e04987824fdde3a96509aaafd141ed71358580704b529ba2a7fc4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sia_storage-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sia_storage-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a9f0fb3a4c7ac27df5ee88b0f2ad8969c83f52971069e37cb098755e5a39ecf5
BLAKE2b-256 checksum
How to use checksums
3e9624d4a8722207f02b3c9aabd500cba12a1116986e9de6dc0bfbe493226ede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sia_storage-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL sia_storage-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6412c10810246b269f7a247e08d9c4caac0549523e0657edcac35e157059c609
BLAKE2b-256 checksum
How to use checksums
2da1c28d154a704c1f00276e426f7db1507413af0cf3989a8a609c343b019c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sia_storage-0.12.0-py3-none-macosx_11_0_arm64.whl

Download URL sia_storage-0.12.0-py3-none-macosx_11_0_arm64.whl
Size 3.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0fbd72d55440cf9294b8d1f38d051a87b6b9db4e3e87a5a81c33ab2693e69959
BLAKE2b-256 checksum
How to use checksums
00d434de2a7d61f6cc2570b868cc57f37159c7437af9a14f60d6709184962368
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sia_storage-0.12.0-py3-none-macosx_10_12_x86_64.whl

Download URL sia_storage-0.12.0-py3-none-macosx_10_12_x86_64.whl
Size 3.9 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d2c419a69a2572270dac666a7dba6f72b91e1c70a34b2d12b68d6569a99016ee
BLAKE2b-256 checksum
How to use checksums
a64d3a2398bad091d779bfa7b3f36f957ac1a458675101d251cce9d28089bdd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.13.1

6 release files

This release

0.12.0 This release

6 release files

0.8.0

6 release files

0.7.0

6 release files

0.4.1

6 release files

0.4.0

6 release files

0.3.0

6 release 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