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.read())
>>> print(f.as_ihex())
: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

This version

3.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bincopy-3.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

bincopy-3.0.0-py2.py3-none-any.whl (7.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for bincopy-3.0.0.tar.gz
Algorithm Hash digest
SHA256 eecae13d767897d77c27082edaa76ea7304e98698545c8b1ab0750eb2203f2ed
MD5 e497217df58712d0b07c727e8e6715df
BLAKE2b-256 708bea0836f0fca2b522a2c7e73463458bb9db8a2b0a0b194180fc2290072f16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bincopy-3.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ec68c9e3703fc6fe7348745c5f698d255d18c4ca896d869677352f6844433aae
MD5 63fdc32c7ba4eba34b9f5b7b0aa4a6fe
BLAKE2b-256 f791aebba3b882f4880113d16cd6b266ec93697143f9cd4de14fc7664480d1b5

See more details on using hashes here.

Supported by

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