Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX and binary files).
Project description
About
Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX and binary files).
Documentation: http://bincopy.readthedocs.org/en/latest
Installation
pip install bincopy
Example usage
Scripting
A basic example converting from Intel HEX to Intel HEX, SREC, binary, array and hexdump formats:
>>> import bincopy
>>> f = bincopy.BinFile("tests/files/in.hex")
>>> print(f.as_ihex())
:20010000214601360121470136007EFE09D219012146017E17C20001FF5F16002148011979
:20012000194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B7321460134219F
:00000001FF
>>> print(f.as_srec())
S32500000100214601360121470136007EFE09D219012146017E17C20001FF5F16002148011973
S32500000120194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B73214601342199
S5030002FA
>>> f.as_binary()
bytearray(b'!F\x016\x01!G\x016\x00~\xfe\t\xd2\x19\x01!F\x01~\x17\xc2\x00\x01
\xff_\x16\x00!H\x01\x19\x19Ny#F#\x96Wx#\x9e\xda?\x01\xb2\xca?\x01Vp+^q+r+s!
F\x014!')
>>> f.minimum_address
256
>>> f.maximum_address
320
>>> len(f)
64
>>> f[f.minimum_address]
bytearray(b'!')
See the test suite for additional examples.
Command line tool
Print general information about given binary format file(s).
$ bincopy info tests/files/in.hex
Data address ranges:
0x00000100 - 0x00000140
Contributing
Fork the repository.
Install prerequisites.
pip install -r requirements.txtImplement the new feature or bug fix.
Implement test case(s) to ensure that future changes do not break legacy.
Run the tests.
make testCreate a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bincopy-10.1.0.tar.gz.
File metadata
- Download URL: bincopy-10.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aa911c0f5e67b7154fe1d852b886eba769619984bcb89380dd9a95948179eea
|
|
| MD5 |
b1ed04e9b6e7d6ad7704a3f260decea3
|
|
| BLAKE2b-256 |
270e8060b2da3a7cabea83b2bb4a457ddd7e467d211e8bdaafc63a6a9d7b174a
|
File details
Details for the file bincopy-10.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: bincopy-10.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d6e0b739d440b9b92d6f6086ee400bb389655d2b639277a6374b189ee8d85f8
|
|
| MD5 |
da47d6fea68eb0299b0ee41063c936b4
|
|
| BLAKE2b-256 |
437212a30d3ebc22a89d6dac7f37139ed0e3944b82732b2a93366a4b0a4952b4
|