substrate-interface
Library for interfacing with a Substrate node
What it is and what it does
substrate-interface is a Python client library for interacting with Substrate-based blockchains like Polkadot and Kusama. It provides methods to query on-chain storage, compose and sign transactions (extrinsics), and handle the SCALE codec used by Substrate runtimes. The library can connect either to a remote node via WebSocket RPC or use an embedded light client.
The package wraps low-level blockchain operations into higher-level Python abstractions, automatically discovering runtime metadata and chain properties from the connected node. It handles cryptographic signing via keypairs, manages account balances and state queries, and abstracts away the complexity of SCALE encoding for common operations. With 16 runtime dependencies including cryptographic libraries (ecdsa, PyNaCl, pycryptodome) and codec tools (scalecodec, xxhash), it provides a complete toolkit for Substrate development.
Use it for:
- Query account balances and storage state from a Polkadot or Kusama node
- Compose and submit signed transactions (extrinsics) to transfer funds or call runtime functions
- Build automation scripts that interact with Substrate-based chains programmatically
- Decode and encode SCALE-formatted data for custom runtime interactions
- Monitor on-chain events and state changes via RPC subscriptions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Interfaces with Substrate blockchain nodes to query storage, compose and submit transactions, and handle SCALE encoding/decoding for Polkadot, Kusama, and other Substrate-based networks.
Yes. Active maintenance, no known vulnerabilities, permissive license, and low install friction make this a solid choice for Substrate blockchain development. The 16 dependencies are well-established cryptographic and networking libraries. Install if you need to interact with Polkadot, Kusama, or other Substrate chains from Python.
Install
substrate-interface on PyPI
pip
pip install substrate-interfaceuv
uv add substrate-interfacepoetry
poetry add substrate-interfaceInstalling substrate-interface
Before you install
Low friction installation with a pure-Python wheel. Actively maintained with recent commits and no known vulnerabilities. Supports Python 3.7 through 3.11.
License in practice
Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install substrate-interface
from substrate_interface import SubstrateInterface
substrate = SubstrateInterface(url="ws://127.0.0.1:9944")
result = substrate.query('System', 'Account', ['F4xQKRUagnSGjFqafyhajLs94e7Vvzvr8ebwYJceKpr8R7T'])
print(result.value['data']['free'])
Requires a running Substrate node RPC endpoint (local or remote) or uses embedded light client via smoldot-light; WebSocket connectivity needed.
Verify before relying
- Performance characteristics when querying large datasets or high-frequency RPC calls
- Compatibility scope with runtimes older than MetadataV14 or under active development
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (<4,>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 16 — websocket-client, base58, certifi, idna, requests, xxhash, ecdsa, eth-keys, eth_utils, pycryptodome, PyNaCl, scalecodec, py-sr25519-bindings, py-ed25519-zebra-bindings, py-bip39-bindings, smoldot-light |
| Maintenance | actively maintained — 206 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 261,738/month — #8,382 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: substrate_interface-1.8.1-py3-none-any.whl
Keywords: interface, polkascan, polkadot, substrate, blockchain, rpc, kusama
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
async-substrate-interfaceProvides asynchronous and synchronous…
permissive · top 15,000 on PyPI
scalecodecEncodes and decodes data using the SCALE codec,…
permissive · top 15,000 on PyPI
smoldot-lightPython bindings for the smoldot_light Rust…
unclear · top 15,000 on PyPI
cyscaleCython-accelerated encoder and decoder for the…
permissive · top 15,000 on PyPI
bittensor-walletManages cryptographic keys and wallets for the…
permissive · top 15,000 on PyPI
aptos-sdkProvides Python bindings to interact with the…
permissive · top 15,000 on PyPI
cosmpyCosmPy provides Python bindings to interact…
permissive · top 15,000 on PyPI
rlpEncodes and decodes data using Recursive Length…
permissive · top 5,000 on PyPI
stellar-sdkStellar SDK provides Python APIs to build and…
permissive · top 15,000 on PyPI
tonsdkLow-level Python library for interacting with…
permissive · top 15,000 on PyPI