{"id":9035,"library":"hexrec","title":"Hexadecimal Record File Handler","description":"hexrec is a Python library designed to handle hexadecimal record files, such as Intel HEX and Motorola S-records. It provides tools for parsing, creating, and manipulating these records and converting between raw data blocks and record formats. The current version is 0.5.1, and it maintains an active release cadence with periodic updates to support newer Python versions and improve features.","status":"active","version":"0.5.1","language":"python","source_language":"en","source_url":"https://github.com/d-ganz/hexrec","tags":["hexadecimal","records","intel-hex","motorola-srec","file-parsing","binary-data"],"install":[{"cmd":"pip install hexrec","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from hexrec.records import IntelHexRecord","symbol":"IhexFile","correct":"from hexrec import IhexFile"},{"symbol":"SrecFile","correct":"from hexrec import SrecFile"},{"symbol":"load","correct":"from hexrec import load"}],"quickstart":{"code":"from hexrec.blocks import Block\nfrom hexrec.records import IntelHexRecord\n\n# Create a Block instance with an address and data\ndata = b'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07'\nblock = Block(address=0x1000, data=data)\nprint(f\"Created Block: Address=0x{block.address:04X}, Data={block.data.hex()}\")\n\n# Convert the Block to IntelHexRecord instances\nrecords = block.to_records(record_type=IntelHexRecord)\n\nprint(\"Generated Intel HEX Records:\")\nfor record in records:\n    print(record.to_line())\n\n# Example of parsing an Intel HEX record line\nline = ':10100000000102030405060708090A0B0C0D0E0F00'\nparsed_record = IntelHexRecord.from_line(line)\nprint(f\"\\nParsed Record: Address=0x{parsed_record.address:04X}, Data={parsed_record.data.hex()}\")\n","lang":"python","description":"This quickstart demonstrates how to create a data Block, convert it into a list of Intel HEX records, and parse a single Intel HEX record line back into a `IntelHexRecord` object using `hexrec.blocks` and `hexrec.records`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer, or pin hexrec to a version <0.5.0 if Python 3.8 is required (e.g., `pip install 'hexrec<0.5.0'`).","message":"Python 3.8 support was dropped in hexrec v0.5.0. The minimum required Python version is now 3.9.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Change `from hexrec.records import Record` to `from hexrec.records import BaseRecord` and update your class inheritance if you were directly subclassing `Record`.","message":"The `Record` base class was removed in hexrec v0.3.0. Users subclassing `Record` should now use `BaseRecord`.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Update all references from `.max_data_len` to `.max_data_length` when accessing the maximum data length for record types.","message":"The `max_data_len` attribute on record classes was renamed to `max_data_length` in hexrec v0.3.0.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Update all imports from `from hexrec.base import ...` to `from hexrec.blocks import ...`.","message":"The `hexrec.base` module was renamed to `hexrec.blocks` in hexrec v0.2.0.","severity":"breaking","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'0.5.1':48 'activ':53 'binari':79 'binary-data':78 'block':40 'cadenc':55 'convert':36 'creat':30 'current':45 'data':39,80 'design':10 'featur':66 'file':3,15,76 'file-pars':75 'format':43 'handl':12 'handler':4 'hex':19,71 'hexadecim':1,13,67 'hexrec':5 'improv':65 'intel':18,70 'intel-hex':69 'librari':9 'maintain':51 'manipul':32 'motorola':21,73 'motorola-srec':72 'newer':61 'pars':29,77 'period':57 'provid':26 'python':8,62 'raw':38 'record':2,14,24,34,42,68 'releas':54 's-record':22 'srec':74 'support':60 'tool':27 'updat':58 'version':46,63","created_at":"2026-04-16T18:48:07.858460+00:00","updated_at":"2026-04-16T18:48:07.858460+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.5.1","cli_name":"hexrec","cli_version":"Usage: hexrec [OPTIONS] COMMAND [ARGS]...","type":"library","homepage":null,"github":"https://github.com/TexZK/hexrec","docs":"https://hexrec.readthedocs.io/en/latest/","changelog":null,"pypi":"https://pypi.org/project/hexrec/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}