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.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sia_storage-0.13.1.tar.gz | 77.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| sia_storage-0.13.1-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| sia_storage-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| sia_storage-0.13.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| sia_storage-0.13.1-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| sia_storage-0.13.1-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 21.3 MB
Release files / sia_storage-0.13.1.tar.gz
| Download URL | sia_storage-0.13.1.tar.gz |
|---|---|
| Size | 77.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f37d1e9a14bd83eec09c5198f43f6fc483399b7a10ee3cdd62cde9d36f2ec03a
|
|
BLAKE2b-256 checksum How to use checksums |
0601ddea71743dd556be93517f7579ffe680d0658ab2e87a7532f55974c41708
|
| 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 Oct 10, 2026.
Transparency logRelease files / sia_storage-0.13.1-py3-none-win_amd64.whl
| Download URL | sia_storage-0.13.1-py3-none-win_amd64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d87873067e4c4344fa11fdc0da50f47634abb96a88068746b346a859e8994057
|
|
BLAKE2b-256 checksum How to use checksums |
45d5f43d9fec2dbc07b4ccc2af9b3df7eb3cc4b0759094162930c6ee21867f80
|
| 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 Oct 10, 2026.
Transparency logRelease files / sia_storage-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sia_storage-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
2a8e2e2273935012858ec368356187d7c161b24d8e30f027ba5c06ae159d95d1
|
|
BLAKE2b-256 checksum How to use checksums |
c9484b323193f7dc9b00c2c54b7477081d3e34cea321558c7295f42b307cbef8
|
| 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 Oct 10, 2026.
Transparency logRelease files / sia_storage-0.13.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | sia_storage-0.13.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
b26cf359d950b5c9354e1a63bfd43af9c00b97c7cdd0798ccb16d9bf9026e3ed
|
|
BLAKE2b-256 checksum How to use checksums |
9dda7cc40ced0c26a74bc6cecfb714465aa269e83a02c02f43a9eec8b82e199a
|
| 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 Oct 10, 2026.
Transparency logRelease files / sia_storage-0.13.1-py3-none-macosx_11_0_arm64.whl
| Download URL | sia_storage-0.13.1-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
15a55e49a7b51225d764c76e9f2013d6b454eb11a9f05d43bfe04f975dfd0c91
|
|
BLAKE2b-256 checksum How to use checksums |
2715b4e65827f0e2967359bd242c627bb130d65037e5accfe8bdf0e2b32d43da
|
| 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 Oct 10, 2026.
Transparency logRelease files / sia_storage-0.13.1-py3-none-macosx_10_12_x86_64.whl
| Download URL | sia_storage-0.13.1-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
115887825d646967714ec60d13ebc910c65d01fc0caa6707d50fa84f6ce71a1f
|
|
BLAKE2b-256 checksum How to use checksums |
1a6ca1f648349a04b3585a3dd0e40cdd0e345f59a80512c0f82f33231b04e7f6
|
| 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 Oct 10, 2026.
Transparency log