Skip to main content

Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX and binary files).

Project description

buildstatus

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()
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!')

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-1.1.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bincopy-1.1.2-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file bincopy-1.1.2.tar.gz.

File metadata

  • Download URL: bincopy-1.1.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bincopy-1.1.2.tar.gz
Algorithm Hash digest
SHA256 2536ad6fcf04dd09ec5b3f98114281e9e2a251f4f780c9eb268b9923c6d76082
MD5 70b07a9af245939e5ab0154ff0dfe44b
BLAKE2b-256 00c753b2555e91b68780d9e6bb8fe33eb2a60b1de8f6ba3d32f6f13db5bd7c05

See more details on using hashes here.

File details

Details for the file bincopy-1.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bincopy-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 45ae8c333a384da3d6c5b2866acaba76de9500af3b2694537a18017db6964aac
MD5 a3601d5bf0f454c522462555ca6b64b0
BLAKE2b-256 f68f606ba63af214f1f918a356622e59668506b3f3f9876670419083fe1b9b6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page