Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX and binary files).
Project description
Installation
pip install bincopy
Example usage
See the test suite: https://github.com/eerimoq/bincopy/blob/master/tests/test_bincopy.py
A basic example converting from Intel HEX to Intel HEX, SREC and binary formats:
>>> import bincopy
>>> f = bincopy.File()
>>> with open("tests/files/in.hex", "r") as fin:
... f.add_ihex(fin)
>>> print(f.as_ihex())
:020000040000FA
:20010000214601360121470136007EFE09D219012146017E17C20001FF5F16002148011979
:20012000194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B7321460134219F
:00000001FF
>>> print(f.as_srec())
S32500000100214601360121470136007EFE09D219012146017E17C20001FF5F16002148011973
S32500000120194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B73214601342199
S5030002FA
>>> f.as_binary()
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!'
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
bincopy-2.1.0.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file bincopy-2.1.0.tar.gz
.
File metadata
- Download URL: bincopy-2.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be43c8899258c38529f1b1034722f8f1690af3a5bc30cc048370fe165fbbf98 |
|
MD5 | c12c32ce788d5745717ea6ca268d9fb5 |
|
BLAKE2b-256 | 725a83aa5adb9679902782a4ddea250091ac75dcce19783fde83e8947cdf4223 |
File details
Details for the file bincopy-2.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: bincopy-2.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba8652ab8ea0cc6314d9e3304e851563bba326144248c8e6ff09b026af2961f7 |
|
MD5 | 0741a5a5f516a2277f2615c94ae85273 |
|
BLAKE2b-256 | dac86e136889fa8fb1f8a0b39c6b5f4772fa43403568e0763f1beaae2a05ff1f |