kaitaistruct
Kaitai Struct declarative parser generator for binary data: runtime library for Python
Decision gist · record as of 2026-08-14
Yes, if you are already using Kaitai Struct to describe binary formats. The runtime is lightweight, permissively licensed, and actively maintained. Install it only after you have a compiled .ksy parser class ready; the library alone does not parse anything without that upstream compilation step. Not relevant if you are hand-writing binary parsers or using a different declarative format.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- You must first compile a .ksy format description file into a Python parser class using the Kaitai Struct compiler; this library provides only the runtime API, not the compiler itself.
- Low install friction with a single lightweight dependency (enum34).
- The package is actively maintained with recent commits, though it has been 340 days since the last release.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2025-09-08 (340 days) · last repo commit 2026-08-08 · 107 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,459,843 downloads/mo, #1,621 on PyPI
Alternatives
Verify before relying
pip install kaitaistruct
from kaitaistruct import KaitaiStream
# Use with a compiled .ksy parser class
with open('file.bin', 'rb') as f:
stream = KaitaiStream(f)
data = YourCompiledParser(stream)- Whether the package works with PyPy as claimed in classifiers, or if there are known limitations.
- Current maintenance cadence and likelihood of future releases given the 340-day gap since last release.
What it is and what it does
Kaitai Struct is a declarative approach to binary data parsing. Instead of writing custom code to read and unpack binary structures, you describe the format in a YAML-based .ksy file, compile it with the Kaitai Struct compiler, and use this runtime library to instantiate and navigate the parsed data. The library implements the Kaitai Struct API for Python, providing stream-based access to binary data with automatic field extraction and type handling.
It is language-agnostic—the same .ksy description can be compiled to many target languages—but this package handles only the Python runtime side. You provide the compiled parser class, and the library handles the low-level stream reading. It supports Python 2.7 and Python 3.4 through 3.13, with a single runtime dependency (enum34 for older Python versions).
Use it for
- Parse custom binary file formats (e.g., image headers, audio metadata) by defining the structure once in .ksy and reusing across languages.
- Decode network packet formats by describing the protocol structure declaratively and letting the runtime extract fields automatically.
- Reverse-engineer or document binary file formats by writing a .ksy description that serves as both specification and working parser.
- Build cross-language tools where the same binary format description compiles to multiple languages, reducing duplication.
- Unpack structured binary data from embedded systems or legacy protocols without manual bit-shifting and byte-order handling.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already using Kaitai Struct to describe binary formats.
The runtime is lightweight, permissively licensed, and actively maintained. Install it only after you have a compiled .ksy parser class ready; the library alone does not parse anything without that upstream compilation step. Not relevant if you are hand-writing binary parsers or using a different declarative format.
Install
kaitaistruct on PyPI
Before you install
Low install friction with a single lightweight dependency (enum34). The package is actively maintained with recent commits, though it has been 340 days since the last release. Supports a wide range of Python versions from 2.7 through 3.13.
You must first compile a .ksy format description file into a Python parser class using the Kaitai Struct compiler; this library provides only the runtime API, not the compiler itself.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install kaitaistruct
from kaitaistruct import KaitaiStream
# Use with a compiled .ksy parser class
with open('file.bin', 'rb') as f:
stream = KaitaiStream(f)
data = YourCompiledParser(stream)
Verify before relying
- Whether the package works with PyPy as claimed in classifiers, or if there are known limitations.
- Current maintenance cadence and likelihood of future releases given the 340-day gap since last release.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageenum34 |
| Maintenance | Actively maintained 340 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,459,843 / month, #1,621 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Build Tools |
Evidence: kaitaistruct-0.11-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “binary data parser”
- kaitaistructKaitai Struct provides a Python runtime library for parsing binary…
- construct-typingAdds type hints and static type checking support to the construct…
- dissect.cstructParse binary data using C-like structure definitions, converting raw…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also construct · plum-py · bitstruct · construct-classes · construct-typing · msgpack · dissect.cstruct · cbitstruct · pycstruct · polyfile-weave