--- id: hachoir version: "3.3.0" license: GNU GPL v2 license_treatment: copyleft maintenance: active --- # hachoir — Package of Hachoir parsers used to open binary files License: copyleft · Maintenance: active · Downloads: 431.0K/mo ## What it is and what it does Hachoir is a Python library for parsing and inspecting binary files at the field level. It represents any binary stream as a tree where each node is a typed field—integers, strings, bits, padding, floats, and more—allowing you to navigate and understand the structure of binary data the way you would browse a filesystem. The library includes command-line tools for common tasks: hachoir-grep searches for text patterns in binary files, hachoir-metadata extracts metadata, hachoir-strip removes metadata, and hachoir-urwid provides a text-mode viewer for interactive browsing. The package has no external runtime dependencies, making installation simple. It is actively maintained and marked as Production/Stable. However, it is licensed under GNU GPL v2 (copyleft), which means any code that uses or modifies it must also be released under GPL v2—a significant constraint for proprietary projects. Use it for: - Extract metadata from image, audio, or video files without relying on format-specific libraries. - Reverse-engineer or analyze binary file formats by visually inspecting their structure field by field. - Search for text patterns or signatures within binary files using hachoir-grep. - Strip or modify metadata from binary files to remove sensitive information before sharing. - Develop custom binary parsers by extending Hachoir's field types and parser framework. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Hachoir parses and displays binary files as a tree of typed fields, letting you inspect and edit individual bits, bytes, and structures within any binary stream. Yes, if you need to inspect or parse binary files and accept the GPL v2 copyleft license. Hachoir is stable, actively maintained, has no external dependencies, and provides both a library API and useful command-line tools. It is not suitable for proprietary projects due to its copyleft license. For one-off binary inspection tasks or open-source work, it is a solid choice. ## Install pip install hachoir uv add hachoir poetry add hachoir ## Installing hachoir Before you install: Installation is straightforward with no runtime dependencies. The package is actively maintained as of 2026-03-06 and marked Production/Stable, though the last release was in 2023. License in practice: Hachoir is licensed under GNU GPL v2 (copyleft). Any derivative work or modification must also be released under GPL v2; proprietary or closed-source projects cannot use it without separate licensing. Quickstart: pip install hachoir from hachoir.parser import createParser from hachoir.stream import FileInputStream parser = createParser("example.bin") if parser: for field in parser: print(field.name, field.value) Requires Python 3.6 or newer. The hachoir-urwid command-line tool requires curses support (typically available on Unix-like systems). Verify before relying: - Whether the package's binary parsing covers modern file formats or is limited to legacy formats. - Performance characteristics when parsing very large binary files. - Whether the editing capabilities support all field types or only a subset. ## Package facts - License: GNU GPL v2 (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 431.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags binary file parser, hex viewer field-based, binary stream inspection, metadata extraction binary, binary file editor, bit-level file analysis, binary format dissection, binary-analysis, metadata-extraction, file-format-parsing [View on SkillFed](https://skillfed.io/packages/hachoir) · [View on PyPI](https://pypi.org/project/hachoir/)