cyscale
Cython SCALE Codec Library
What it is and what it does
cyscale is a Cython-compiled SCALE codec library for Substrate-based blockchains. It keeps the same module name and most of the API surface as py-scale-codec but diverges in a key way: its optimized decode paths return plain Python values (int, str, bool, dict, list, tuple, None) directly rather than wrapping them in ScaleType objects. This makes it faster but breaks drop-in compatibility for code that expects the object tree structure.
The library supports encoding and decoding SCALE types used across Polkadot, Kusama, and Bittensor networks. It includes a batch_decode API for amortizing Python dispatch overhead across multiple decodes. The classic object API remains available as a fallback for types not covered by the optimized paths, so encode operations and exotic types behave as before. No external runtime dependencies.
Use it for:
- Decode Polkadot or Kusama blockchain extrinsics, events, and calls at high throughput in indexers or monitoring tools.
- Parse large metadata payloads from Substrate chains during chain inspection or code generation.
- Batch-decode account IDs or other SCALE types in bulk operations, leveraging the batch_decode API.
- Encode and decode Bittensor network data and metadata in machine-learning pipelines that require fast serialization.
- Build Substrate chain explorers or wallets where decode latency directly impacts user-facing responsiveness.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cython-accelerated encoder and decoder for the SCALE codec used by Substrate-based blockchains (Polkadot, Kusama, Bittensor), producing plain Python values instead of object trees.
Yes, if you are working with Substrate-based blockchains and can accept that decode output is plain Python values rather than ScaleType objects. The performance gains are substantial for high-throughput indexing or metadata parsing. If your codebase relies on the object tree API or expects `.value` / `.value_object` wrappers, migration is required but the shapes of the returned data remain the same. No known vulnerabilities, active maintenance, and permissive licensing make it a sound choice.
Install
cyscale on PyPI
pip
pip install cyscaleuv
uv add cyscalepoetry
poetry add cyscaleInstalling cyscale
Before you install
Medium install friction due to compiled wheels; however, wheels are pre-built for Python 3.10, 3.11, 3.12, 3.13, and 3.14 across macOS, Linux, and Windows, so installation is typically straightforward. Actively maintained with a recent release.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in most commercial and open-source projects without significant restriction.
Quickstart
pip install cyscale
from cyscale import Codec
codec = Codec('u32')
value = codec.decode(b'\x2a\x00\x00\x00')
print(value)
Requires Python 3.10 or later; pre-built wheels are available for common platforms but installation on unsupported architectures may require compilation.
Verify before relying
- Whether the plain-value decode output is sufficient for all use cases that previously relied on ScaleType object trees.
- Performance gains on real-world metadata decoding workloads in production Substrate applications.
- Compatibility status with ecosystem tools that may expect the original py-scale-codec object API.
- Actual API surface and method names available in cyscale for encoding and decoding operations.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 5 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 269,884/month — #8,248 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cyscale-0.8.0-cp310-cp310-macosx_10_9_x86_64.whl; cyscale-0.8.0-cp310-cp310-macosx_11_0_arm64.whl; cyscale-0.8.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cyscale-0.8.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cyscale-0.8.0-cp310-cp310-musllinux_1_2_aarch64.whl; cyscale-0.8.0-cp310-cp310-musllinux_1_2_x86_64.whl; cyscale-0.8.0-cp310-cp310-win32.whl; cyscale-0.8.0-cp310-cp310-win_amd64.whl; cyscale-0.8.0-cp310-cp310-win_arm64.whl; cyscale-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl; cyscale-0.8.0-cp311-cp311-macosx_11_0_arm64.whl; cyscale-0.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; cyscale-0.8.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cyscale-0.8.0-cp311-cp311-musllinux_1_2_aarch64.whl; cyscale-0.8.0-cp311-cp311-musllinux_1_2_x86_64.whl; cyscale-0.8.0-cp311-cp311-win32.whl; cyscale-0.8.0-cp311-cp311-win_amd64.whl; cyscale-0.8.0-cp311-cp311-win_arm64.whl; cyscale-0.8.0-cp312-cp312-macosx_10_13_x86_64.whl; cyscale-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Keywords: scale, codec, polkascan, polkadot, substrate, blockchain, kusama, cython, bittensor
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 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
substrate-interfaceInterfaces with Substrate blockchain nodes to…
permissive · top 15,000 on PyPI
pynvvideocodecPyNvVideoCodec provides hardware-accelerated…
permissive · top 15,000 on PyPI
bittensorBittensor is a Python SDK and CLI for…
permissive · top 15,000 on PyPI
bittensor-walletManages cryptographic keys and wallets for the…
permissive · top 15,000 on PyPI
encodecEnCodec is a neural audio codec that compresses…
noncommercial · top 15,000 on PyPI
smoldot-lightPython bindings for the smoldot_light Rust…
unclear · top 15,000 on PyPI
nvidia-nvimgcodec-cu12nvImageCodec provides GPU-accelerated codec…
permissive · top 15,000 on PyPI
cyseqcyseq provides a Cython-optimized…
permissive · top 15,000 on PyPI