Skip to main content

pyiota

CI

Python SDK for IOTA Rebased -- the Move-based Layer 1 blockchain.

pyiota provides a developer-friendly Python interface for interacting with IOTA Rebased nodes via JSON-RPC. It supports client-side transaction building with BCS serialization, Ed25519 signing, and typed responses.

Status: Alpha -- API may change before 1.0.

Features

  • Async-first client with sync wrapper (powered by httpx)
  • Client-side Programmable Transaction Block building with BCS serialization
  • Ed25519 keypair generation, import, and transaction signing
  • Typed responses using Pydantic v2 models
  • Coin, object, balance, and event queries
  • Testnet faucet integration
  • API aligned with the IOTA TypeScript SDK conventions

Installation

pip install iota-rebased

Optional extras:

pip install "iota-rebased[secp256k1]"   # Secp256k1 signing support
pip install "iota-rebased[mnemonic]"    # BIP-39 mnemonic key derivation

Requires Python 3.12+.

Note: The PyPI package is iota-rebased; the import name is pyiota. The separate pyiota package on PyPI is unrelated and installs a conflicting pyiota module.

Quick Start

import asyncio
from pyiota import IotaClient, Network, Transaction, NANOS_PER_IOTA
from pyiota.crypto import Ed25519Keypair

async def main():
    sender = Ed25519Keypair.generate()
    recipient = Ed25519Keypair.generate()

    async with IotaClient(Network.TESTNET) as client:
        # Fund the sender from the testnet faucet
        await client.request_testnet_tokens(sender.address)
        await asyncio.sleep(3)

        # Check balance
        balance = await client.get_balance(owner=sender.address)
        print(f"Balance: {balance.total_balance_int / NANOS_PER_IOTA} IOTA")

        # Transfer 0.1 IOTA
        tx = Transaction()
        coin = tx.split_coins(tx.gas, [NANOS_PER_IOTA // 10])
        tx.transfer_objects([coin], recipient.address)

        tx_bytes = await tx.build(client=client, signer=sender)
        result = await client.sign_and_execute_transaction(
            signer=sender, tx_bytes=tx_bytes
        )
        print(f"Transaction: {result.digest}")

asyncio.run(main())

Sync Usage

from pyiota import SyncIotaClient, Network, Transaction
from pyiota.crypto import Ed25519Keypair

keypair = Ed25519Keypair.generate()

with SyncIotaClient(Network.TESTNET) as client:
    balance = client.get_balance(owner=keypair.address)
    print(f"Balance: {balance.total_balance_int}")

Move Call

tx = Transaction()
tx.move_call(
    target="0xPACKAGE::module::function",
    arguments=[tx.pure_string("hello"), tx.object("0xOBJECT_ID")],
    type_arguments=["0x2::coin::Coin<0x2::iota::IOTA>"],
)

API Reference

Client Methods

Method Description
get_balance(owner, coin_type?) Get coin balance for an address
get_all_balances(owner) Get all coin type balances
get_coins(owner, coin_type?, cursor?, limit?) Get coin objects (paginated)
get_object(object_id, show_*?) Get an object by ID
get_owned_objects(owner, ...) Get objects owned by address
multi_get_objects(object_ids, ...) Batch get objects
execute_transaction_block(tx_bytes, signatures, ...) Submit signed transaction
sign_and_execute_transaction(signer, tx_bytes, ...) Sign and submit
dev_inspect_transaction_block(sender, tx_bytes) Dry-run (no gas)
dry_run_transaction_block(tx_bytes) Dry-run (with gas estimation)
query_events(query, ...) Query emitted events
wait_for_transaction(digest, ...) Poll until indexed
get_reference_gas_price() Current gas price
get_chain_identifier() Chain genesis digest
request_testnet_tokens(recipient) Faucet (test networks only)

Transaction Builder

Method Description
tx.split_coins(coin, amounts) Split a coin into new coins
tx.transfer_objects(objects, recipient) Transfer objects to address
tx.merge_coins(destination, sources) Merge coins together
tx.move_call(target, arguments?, type_arguments?) Call a Move function
tx.pure(value, type_hint?) Create a pure input value
tx.object(object_id, ...) Create an object reference input
tx.build(client, signer?) Build to BCS bytes (async)
tx.build_sync(client, signer?) Build to BCS bytes (sync)

Development

git clone https://github.com/Consensix-Labs/pyiota.git
cd pyiota
pip install -e ".[dev]"

# Run unit tests
pytest tests/unit/

# Run integration tests (requires network)
pytest tests/integration/ -m integration

# Lint and format
ruff check src/ tests/
ruff format src/ tests/

# Type check
mypy src/pyiota/

Docker

# Unit tests
docker compose run --rm test-unit

# Integration tests (hits IOTA testnet)
docker compose run --rm test-integration

License

MIT -- see LICENSE.

Metadata

Release files for iota-rebased 0.1.1

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

Source distribution (sdist)

Source distribution for iota-rebased 0.1.1
File Size Uploaded
iota_rebased-0.1.1.tar.gz 42.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iota-rebased 0.1.1
File Interpreter ABI Platform
iota_rebased-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 76.6 kB

Release files / iota_rebased-0.1.1.tar.gz

Download URL iota_rebased-0.1.1.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f04aeddd197f68d41d2044f76e9c48696cddc28bee70fab4c2ace99ab9a02c51
BLAKE2b-256 checksum
How to use checksums
c0e4f74157ec61a0b76a04cc082ddf5c07f382e41ef9d63cceb987d09c55e66d
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 Oct 10, 2026.

Transparency log

Release files / iota_rebased-0.1.1-py3-none-any.whl

Download URL iota_rebased-0.1.1-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa611dcb14338586ae02f540abb26aae98166b5d6147cbad413f7fe8120932b9
BLAKE2b-256 checksum
How to use checksums
9e6c51bb3573e5744fa0e69fbc009f13097dccdea2892da3cb70ce6aa9495bf7
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 Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 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