=======
This is a simple library for parsing hex files. Currently only intel hex files are supported.
Installation
------------
You can use the included setup.py or use your pip to install it from PyPI
Usage
-----
To create a HexFile object use hexfile.load:
```python
import hexfile
f = hexfile.load('memory.hex')
```
The `HexFile` object is composed of one or more memory segments, which may be discontinuous. You can access the contents of the hex file as though it were an array of bytes:
```python
print f.size # Total number of bytes in the hexfile (NOT the total span of all addresses)
byte = f[16] # Returns the byte at address 16 (as an int)
bytes = f[256:512] # Returns 256 bytes as a list
print f.segments # Display all the segments in the hex file
```
The `HexFile` object also supports iteration, but rather than iterating over byte values as if it were a list, it includes the byte addresses, as if it were enumerated. This is because the file might be discontinuous, so addresses are frequently needed during iteration.
```
for addr, data in f:
print '0x%08x : 0x%02x' % (addr, data) # Print every byte in the hex file and its 32-bit address
```
Metadata
Release files for hexfile 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hexfile-0.1.1.tar.gz | 2.9 kB | Without provenance | Details for hexfile-0.1.1.tar.gz |
Release files / hexfile-0.1.1.tar.gz
| Download URL | hexfile-0.1.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44bc78c7f6ff531c1af7c1e5bcea8a327d17139d789e9f4fc3ad228030009459
|
|
BLAKE2b-256 checksum How to use checksums |
db33449e0144debb721085bd7d09689029cdbb927c7f0dd2000cb726420db746
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for hexfile 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.