--- id: hexrec version: "0.5.1" license: BSD-2-Clause license_treatment: permissive maintenance: aging --- # hexrec — Library to handle hexadecimal record files License: permissive · Maintenance: aging · Downloads: 223.2K/mo ## What it is and what it does Hexrec is a library for working with hexadecimal record files—the text-based formats (Intel HEX and Motorola S-record) used in embedded systems to exchange binary data destined for microcontroller flash, EEPROM, or other non-volatile memory. It provides high-level functions to load, parse, edit, and save these files, as well as convert between formats, merge multiple files, and manipulate sparse binary data through a bytearray-like interface backed by bytesparse. The library addresses a real pain point in embedded development: toolchain support for hex formats is often incomplete or buggy, and manual editing of record files is tedious because checksums and record boundaries must be recalculated. Hexrec handles that bookkeeping automatically. It can also be run as a command-line tool for common operations like format conversion, merging, and cropping. Use it for: - Convert a bootloader and application executable from HEX to SREC format for a board factory that accepts only one format. - Merge multiple hex files (bootloader, app, config data) into a single file for microcontroller programming. - Extract and modify a specific address range in a hex file (e.g., trim an app to fit a bootloader-reserved region). - Generate test datasets by programmatically creating hex records with structured binary data at specific memory addresses. - Compute and inject a CRC into a hex file at a predetermined address without re-compiling the firmware. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Loads, edits, and saves hexadecimal record files (Intel HEX and Motorola S-record formats) commonly used in embedded systems to represent binary data for non-volatile memory. Yes. The package solves a genuine embedded-systems problem with low install friction, permissive licensing, and no known vulnerabilities. The aging maintenance status (385 days since release) is a minor concern but not a blocker, given that the repository is not archived and the last commit is recent. Install if you regularly work with hex or SREC files. ## Install pip install hexrec uv add hexrec poetry add hexrec ## Installing hexrec Before you install: Low install friction with a pure-Python wheel and only three runtime dependencies. The package is aging (385 days since last release) but the repository remains active with a recent commit on 2025-07-25, suggesting maintenance rather than abandonment. License in practice: BSD-2-Clause is permissive and poses no significant restriction on use, modification, or distribution in most commercial or open-source contexts. Quickstart: pip install hexrec from hexrec import convert convert('data.hex', 'data.srec') # Or merge multiple files: from hexrec import merge merge(['bootloader.hex', 'app.mot', 'config.xtek'], 'merged.srec') Requires Python 3.9 or later. Verify before relying: - Whether the package's sparse memory editing via bytesparse is performant for large binary files - Completeness of support for all Intel HEX and Motorola S-record variants in the wild ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 223.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags hex file conversion, intel hex srec parser, embedded binary record files, hexadecimal record format, hex file merge edit, motorola s-record handler, embedded systems hex tools, embedded-systems, binary-formats, cli-tool [View on SkillFed](https://skillfed.io/packages/hexrec) · [View on PyPI](https://pypi.org/project/hexrec/)