--- id: cyscale version: "0.8.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # cyscale — Cython SCALE Codec Library License: permissive · Maintenance: active · Downloads: 269.9K/mo ## 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 above — 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 pip install cyscale uv add cyscale poetry add cyscale ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 269.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scale codec substrate, polkadot blockchain encoding, cython fast codec, kusama scale decoder, bittensor serialization, blockchain data encoding, substrate metadata parsing, blockchain-codec, substrate, cython-accelerated [View on SkillFed](https://skillfed.io/packages/cyscale) · [View on PyPI](https://pypi.org/project/cyscale/)