Skip to main content

Autonomi FFI — Python bindings

Direct-network, daemon-less Autonomi client for Python, generated by UniFFI from the ant-ffi Rust crate — the same compiled library that backs the Swift and Kotlin mobile SDKs. Unlike antd (which talks to a running antd daemon over REST/gRPC), this embeds the network client in-process, exactly like the mobile bindings.

Async Client methods are real async def — they run on Rust's tokio runtime and bridge to asyncio, so await client.data_put_public(...) works from plain asyncio with no extra event-loop setup.

Package name. The distribution is ant-sdk (matches this repo) — a working title, distribution name only: the import name is ant_ffi, fixed by the UniFFI crate namespace (pip install ant-sdk, then import ant_ffi). If a product-level rename happens, the PyPI project will be deleted and recreated under the new name. Track: V2-880.

Layout

python/
├── ant_ffi/
│   ├── __init__.py         # re-exports the generated surface
│   ├── ant_ffi.py          # generated by uniffi-bindgen (do not edit)
│   └── libant_ffi.dylib    # bundled native lib (per-platform; not committed)
├── examples/
│   └── upload_download_demo.py
├── tests/
│   └── test_smoke.py       # offline: import + version + address derivation
├── pyproject.toml
└── README.md

The generated ant_ffi.py and the bundled native library are build outputs — regenerate them with ffi/scripts/build.sh (which now includes a Python step).

Build the bindings

cd ffi/rust && cargo build --release -p ant-ffi
./target/release/uniffi-bindgen generate \
    --library target/release/libant_ffi.dylib \
    --language python --out-dir ../python/ant_ffi/
cp target/release/libant_ffi.dylib ../python/ant_ffi/   # or .so / .dll

(ffi/scripts/build.sh does all of the above alongside the C#/Kotlin/Swift steps.)

Build & check a wheel

This is a wheel-only distribution. sdist is deliberately blocked — a source tarball would embed this host's native library under a platform-neutral name — and the wheel build refuses to run unless the generated module and native library are staged (otherwise the wheel would install cleanly and fail on first import). Build and verify with:

cd ffi/python && python3 -m build --wheel
../scripts/check-python-wheel.sh   # installs into a throwaway venv + imports

Smoke test (offline, no network)

cd ffi/python && python3 tests/test_smoke.py

Upload/download demo (needs a devnet)

Start a local devnet (writes ~/.ant-dev/devnet-manifest.json):

cd ant-node && cargo run --release --bin ant-devnet -- \
    --preset small --enable-evm --manifest ~/.ant-dev/devnet-manifest.json

Then run the round-trip demo — connect from the manifest, upload a file (the manifest wallet pays inside ant-core), download it back, verify byte-identical:

cd ffi/python && python3 examples/upload_download_demo.py

Progress callbacks & threading

_with_progress / download_*_to_file methods take a ProgressListener (subclass it, implement on_progress). Callbacks arrive on a Rust/tokio worker thread, not the asyncio event loop. asyncio is not thread-safe, so to touch event-loop state from a callback, hop back with loop.call_soon_threadsafe(...). Keep callbacks quick — events flow through a bounded channel and a slow callback backpressures the transfer.

Release files for ant-sdk 0.0.9

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

Built distributions (wheels)

Table of built distributions (wheels) for ant-sdk 0.0.9
File
ant_sdk-0.0.9-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
ant_sdk-0.0.9-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
ant_sdk-0.0.9-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
ant_sdk-0.0.9-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details

Total release size: 58.4 MB

Release files / ant_sdk-0.0.9-py3-none-win_amd64.whl

Download URL ant_sdk-0.0.9-py3-none-win_amd64.whl
Size 9.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
fe59e67b89269c440831ad97fada4724caec7bb6b8c9c107dba7a5e4518d3e90
BLAKE2b-256 checksum
How to use checksums
299e732bb036c82678ea3dfcde7a65151d2781b50f4dd448bb78c8a93bcef06e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 4, 2026.

Transparency log

Release files / ant_sdk-0.0.9-py3-none-manylinux_2_28_x86_64.whl

Download URL ant_sdk-0.0.9-py3-none-manylinux_2_28_x86_64.whl
Size 13.7 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1251b28928bd7b56c96b781f8860b1b9dc4acef97a0774ce323a1daa20166a40
BLAKE2b-256 checksum
How to use checksums
3ad214a4ba3e57623a7ab4f131e324c119d63dcb87077de6674a7a9542389048
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 4, 2026.

Transparency log

Release files / ant_sdk-0.0.9-py3-none-manylinux_2_28_aarch64.whl

Download URL ant_sdk-0.0.9-py3-none-manylinux_2_28_aarch64.whl
Size 14.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
befbe4ff599f60075083134b124e40c277627bd5fd834c41f0c7c5cf12200d9b
BLAKE2b-256 checksum
How to use checksums
e92eef53421fd4d1f979bb186585fc30d1dd92cc1a3234051f8de2a3e4fd04df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 4, 2026.

Transparency log

Release files / ant_sdk-0.0.9-py3-none-macosx_11_0_universal2.whl

Download URL ant_sdk-0.0.9-py3-none-macosx_11_0_universal2.whl
Size 20.8 MB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
9addebd41d16f84369052683beda684001a5fda1bed185b5b5c0468d3d45ac42
BLAKE2b-256 checksum
How to use checksums
061995deb80ce377c7730bd0466c2d389e30fb131a4fef61c280d7abfa90465d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.9 This release

4 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