skillfed

async-substrate-interface

Asyncio library for interacting with substrate. Mostly API-compatible with py-substrate-interface

async-substrate-interface v2.2.1 382.9K downloads/30d#7,083 on PyPI14
Permissive license MIT License Copyright (c) 2025 Opentensor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) Abandoned released

What it is and what it does

Async-substrate-interface is a Python library that wraps asynchronous and synchronous access to Substrate-based blockchains (like Polkadot). It lets you query chain state, decode data using the SCALE codec, and interact with blockchain RPC endpoints without blocking your event loop. The library provides both an AsyncSubstrateInterface for async/await patterns and a synchronous SubstrateInterface for blocking code, plus specialized variants like DiskCachedAsyncSubstrateInterface that persist query results to disk across runs.

The package depends on aiosqlite, cyscale, typing_extensions, websockets, and xxhash to handle async database operations, fast SCALE decoding, type hints, WebSocket connections, and hashing. It includes three layers of caching—in-memory LRU for both sync and async, plus optional disk persistence—tunable via environment variables. The main gotcha is a namespace conflict with py-scale-codec (scalecodec); the documentation explicitly requires that only cyscale be installed.

Use it for:

  • Query account balances or storage state from Polkadot or other Substrate networks in an async application without blocking.
  • Build a bot or monitoring tool that repeatedly fetches block hashes and runtime metadata, leveraging the built-in LRU and disk caches to reduce network calls.
  • Integrate Substrate chain queries into a larger async service (e.g., a web API or background worker) that needs non-blocking blockchain reads.
  • Decode SCALE-encoded blockchain data quickly using cyscale's optimized codec instead of the slower py-scale-codec.
  • Persist blockchain metadata and query results to disk for tools like btcli that need cache survival across restarts.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides asynchronous and synchronous interfaces for querying and interacting with Substrate-based blockchains, using cyscale for SCALE codec decoding.

No—not for new projects. The repository is archived and the project is marked abandoned, meaning no active maintenance, security updates, or bug fixes are forthcoming. While the code may work for stable Substrate networks today, you assume all responsibility for future compatibility and security issues. Consider this only if you are maintaining legacy code that already depends on it and cannot migrate to an actively maintained alternative.

Install

async-substrate-interface on PyPI

pip

pip install async-substrate-interface

uv

uv add async-substrate-interface

poetry

poetry add async-substrate-interface

Installing async-substrate-interface

Before you install

Low install friction with a pure-Python wheel distribution. However, the repository is archived and marked abandoned as of the fact sheet date, meaning no active maintenance or security updates are expected going forward.

License in practice

MIT License permits free use, modification, and distribution with minimal restrictions. You may use this in commercial projects, but the abandoned status means you assume responsibility for any future fixes or security patches.

Quickstart

pip install async-substrate-interface

from async_substrate_interface import AsyncSubstrateInterface
import asyncio

async def main():
    substrate = AsyncSubstrateInterface(url="wss://rpc.polkadot.io")
    async with substrate:
        result = await substrate.query(
            module='System',
            storage_function='Account',
            params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
        )
        print(result)

asyncio.run(main())

Requires Python 3.10 or later (supports up to 3.14). If cyscale and py-scale-codec (scalecodec) are both installed, you must uninstall both and reinstall only cyscale to avoid namespace conflicts.

Verify before relying

  • Whether the abandoned status affects real-world reliability for stable Substrate networks or if the API remains functional despite no active maintenance.
  • Performance characteristics of cyscale-based SCALE decoding compared to alternatives in production workloads.
  • Compatibility with recent Substrate runtime versions and whether breaking changes have occurred since the last release on 2026-06-29.

Package facts

License MIT License Copyright (c) 2025 Opentensor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — aiosqlite, cyscale, typing_extensions, websockets, xxhash
Maintenance abandoned — 46 days since the last release
Last repo commit (repository archived)
First released
Downloads 382,937/month — #7,083 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: async_substrate_interface-2.2.1-py3-none-any.whl

Keywords: substrate, development, bittensor

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries

Tags

substrate blockchain async clientpolkadot rpc interfacesubstrate query libraryasync blockchain interactionsubstrate network interfaceblockchain rpc client pythonsubstrate chain queries
substrate-blockchainasync-rpcabandoned-project

More Libraries packages