--- id: scalecodec version: "1.2.12" license: unclear license_treatment: permissive maintenance: aging --- # scalecodec — Python SCALE Codec Library License: permissive · Maintenance: aging · Downloads: 345.4K/mo ## What it is and what it does Scalecodec is a Python implementation of the SCALE codec, the serialization format used by Substrate and Polkadot-based blockchains. It provides encoding and decoding for a range of data types—from basic integers and booleans to complex aggregates like vectors and bit sequences—using little-endian fixed-width and compact integer formats to minimize network overhead. The package is typically used by developers building tools, wallets, or indexers that interact with Substrate chains, where they need to serialize Python objects into SCALE format for on-chain calls or deserialize chain data back into Python types. It depends on more-itertools, base58, and requests, and targets Python 3.6 and later. Use it for: - Serialize transaction data for submission to Polkadot or Kusama networks. - Deserialize blockchain state and event data returned from Substrate RPC endpoints. - Build indexers or data pipelines that read and transform on-chain events. - Encode function arguments for extrinsic calls in Substrate-based applications. - Integrate blockchain data into Python-based analytics or monitoring tools. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Encodes and decodes data using the SCALE codec, a lightweight serialization format used by Substrate-based blockchains to optimize network communication. Yes, if you are building on Substrate or Polkadot. The package is stable, permissively licensed, and has low install friction. Maintenance is aging but the repository is not archived and the package remains in active use. No known vulnerabilities. Not relevant for non-blockchain Python projects. ## Install pip install scalecodec uv add scalecodec poetry add scalecodec ## Installing scalecodec Before you install: Low install friction with a pure Python wheel. Maintenance is aging—last commit was 302 days ago—but the repository remains active and the package is marked Production/Stable. License in practice: Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions. Quickstart: pip install scalecodec from scalecodec.base import RuntimeConfiguration from scalecodec.types import U16 config = RuntimeConfiguration() value = U16(42) encoded = value.encode() print(encoded.hex()) Requires Python 3.6 or later; designed for Substrate/Polkadot ecosystem integration. Verify before relying: - Whether the package handles all Substrate runtime types beyond the basic examples shown in the description. - Performance characteristics when encoding/decoding large or deeply nested data structures. - Compatibility with the latest Substrate runtime versions and breaking changes. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 345.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scale codec encoding decoding, substrate serialization, polkadot data serialization, blockchain scale codec, compact integer encoding, substrate network protocol, scale codec python, blockchain, substrate-polkadot, serialization [View on SkillFed](https://skillfed.io/packages/scalecodec) · [View on PyPI](https://pypi.org/project/scalecodec/)