skillfed

substrate-interface

Library for interfacing with a Substrate node

substrate-interface v1.8.1 261.7K downloads/30d#8,382 on PyPI256
Permissive license Active released

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-interface

uv

uv add substrate-interface

poetry

poetry add substrate-interface

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

substrate blockchain interfacepolkadot python clientsubstrate rpc libraryscale encoding decodingkusama node interaction
blockchaincryptographyrpc-client

More Internet packages