About

The hexformat Python package allows the processing of several HEX data formats. Supported formats are the Intel-Hex format, the Motorola S-Record format as well as the simple hex dump format. The first two are often used for programming microcontrollers while the last is often used to display binary data in a user readable way.

Files in the mentioned format can be created, modified (e.g. set, delete and fill data) and read from or written to files. A base class MultiPartBuffer is provided which implements the handling of multiple data parts where every part is identified by its corresponding start address. This base class allows for the basic operations like reading and writing binary files as well as modifing the binary data. The specific classes IntelHex, SRecord and HexDump are derivated from it which implement the parsing and generating of the corresponding HEX formats as well as implementing file format specific features.

Motivation

This package was mainly created to replace the srecord command line tool and its complicated interface with a clean python interface for use with handling microcontroller HEX files. The existing Python library intelhex was used for a while, but then the need for the S-Record format appeared. Also intelhex.IntelHex did not provide a suitable interface for the most often used operations.

License

This work is free software under the GPL v3 or any later version:

Copyright (C) 2015-202 Martin Scharrer <martin.scharrer@web.de>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Contents:

Indices and tables