Skip to main content

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

Project description

buildstatus coverage

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()
>>> f.add_file("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

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

Uploaded Source

Built Distribution

bincopy-8.0.0-py2.py3-none-any.whl (10.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for bincopy-8.0.0.tar.gz
Algorithm Hash digest
SHA256 b7ddd5b7bc59a87f124f86d44f13bbc90b9a18bf5a6834e6ca2ce6b6674f8111
MD5 d8cfd402ab2fe3a72252d34fe49065e5
BLAKE2b-256 cd59a630becdd383cb958396b9e822873beaf06908808bd7406122ff2d1747ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bincopy-8.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d14365ca9b5b1b2e8f2cb3eb39f00de238a9c0f39600027954696d8ba8022cf8
MD5 92ce3cf0dea28da344fd0b1c13b70642
BLAKE2b-256 9b8da8fd4764e166f3a9d75916bb10c4af70ab4b6153fa5e7ac96d0ae92903b8

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