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, binary and array formats:

>>> import bincopy
>>> f = bincopy.BinFile()
>>> f.add_ihex_file("tests/files/in.hex")
>>> 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!'

>>> f.as_array()
'0x21, 0x46, 0x01, 0x36, 0x01, 0x21, 0x47, 0x01, 0x36, 0x00, 0x7e, 0xfe, 0x09, 0xd2, 0x19, 0x01, 0x21, 0x46, 0x01, 0x7e, 0x17, 0xc2, 0x00, 0x01, 0xff, 0x5f, 0x16, 0x00, 0x21, 0x48, 0x01, 0x19, 0x19, 0x4e, 0x79, 0x23, 0x46, 0x23, 0x96, 0x57, 0x78, 0x23, 0x9e, 0xda, 0x3f, 0x01, 0xb2, 0xca, 0x3f, 0x01, 0x56, 0x70, 0x2b, 0x5e, 0x71, 0x2b, 0x72, 0x2b, 0x73, 0x21, 0x46, 0x01, 0x34, 0x21'

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

Uploaded Source

Built Distribution

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

bincopy-5.2.0-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for bincopy-5.2.0.tar.gz
Algorithm Hash digest
SHA256 bc3010ca73f6d1b7dff11fd9ad25d5246c82deeddd35a79b10ed37a48e1c03be
MD5 e14cd1e3fb796237fb43aa356c192ce3
BLAKE2b-256 ffe821ac6bcb120a3a016de8e2cd254025bd4f0aea68cabd28a35e73bfa2b9bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bincopy-5.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6b5edca3e8934e53b7377ec31e93784b9789526f69ebe596fe466873b65be264
MD5 bfcaf9abd46462a7706aebd9fc6ae184
BLAKE2b-256 4c3b6ef53bd233050c7a81cccc6da34f5fe94c0fe6fa7d5c8dc473fb88adfb73

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