{"id":18913565,"url":"https://github.com/eerimoq/bincopy","last_synced_at":"2025-04-08T08:15:38.567Z","repository":{"id":31045434,"uuid":"34604090","full_name":"eerimoq/bincopy","owner":"eerimoq","description":"Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX, TI-TXT, Verilog VMEM, ELF and binary files).","archived":false,"fork":false,"pushed_at":"2025-01-22T17:08:54.000Z","size":1084,"stargazers_count":112,"open_issues_count":7,"forks_count":37,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-01T05:38:07.419Z","etag":null,"topics":["binary","hexdump","intel-hex","python","s-record","ti-txt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eerimoq.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"eerimoq"}},"created_at":"2015-04-26T08:37:28.000Z","updated_at":"2025-01-22T17:08:58.000Z","dependencies_parsed_at":"2022-09-01T16:41:35.004Z","dependency_job_id":"ed44cb7d-2a3a-4501-9e09-21daf168b324","html_url":"https://github.com/eerimoq/bincopy","commit_stats":{"total_commits":224,"total_committers":9,"mean_commits":24.88888888888889,"dds":0.0848214285714286,"last_synced_commit":"c793e178935ea5496b2dcd8f82f244a93254e0ee"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fbincopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fbincopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fbincopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerimoq%2Fbincopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eerimoq","download_url":"https://codeload.github.com/eerimoq/bincopy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801175,"owners_count":20998339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","hexdump","intel-hex","python","s-record","ti-txt"],"created_at":"2024-11-08T10:08:16.062Z","updated_at":"2025-04-08T08:15:38.538Z","avatar_url":"https://github.com/eerimoq.png","language":"Python","funding_links":["https://github.com/sponsors/eerimoq"],"categories":[],"sub_categories":[],"readme":"About\n=====\n\nMangling of various file formats that conveys binary information\n(Motorola S-Record, Intel HEX, TI-TXT, Verilog VMEM, ELF and binary\nfiles).\n\nProject homepage: https://github.com/eerimoq/bincopy\n\nDocumentation: https://bincopy.readthedocs.io\n\nInstallation\n============\n\n.. code-block:: python\n\n    pip install bincopy\n\nExample usage\n=============\n\nScripting\n---------\n\nA basic example converting from Intel HEX to Intel HEX, SREC, binary,\narray and hexdump formats:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import bincopy\n    \u003e\u003e\u003e f = bincopy.BinFile(\"tests/files/in.hex\")\n    \u003e\u003e\u003e print(f.as_ihex())\n    :20010000214601360121470136007EFE09D219012146017E17C20001FF5F16002148011979\n    :20012000194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B7321460134219F\n    :00000001FF\n\n    \u003e\u003e\u003e print(f.as_srec())\n    S32500000100214601360121470136007EFE09D219012146017E17C20001FF5F16002148011973\n    S32500000120194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B73214601342199\n    S5030002FA\n\n    \u003e\u003e\u003e print(f.as_ti_txt())\n    @0100\n    21 46 01 36 01 21 47 01 36 00 7E FE 09 D2 19 01\n    21 46 01 7E 17 C2 00 01 FF 5F 16 00 21 48 01 19\n    19 4E 79 23 46 23 96 57 78 23 9E DA 3F 01 B2 CA\n    3F 01 56 70 2B 5E 71 2B 72 2B 73 21 46 01 34 21\n    q\n\n    \u003e\u003e\u003e print(f.as_verilog_vmem())\n    @00000100 21 46 01 36 01 21 47 01 36 00 7E FE 09 D2 19 01 21 46 01 7E 17 C2 00 01 FF 5F 16 00 21 48 01 19\n    @00000120 19 4E 79 23 46 23 96 57 78 23 9E DA 3F 01 B2 CA 3F 01 56 70 2B 5E 71 2B 72 2B 73 21 46 01 34 21\n\n    \u003e\u003e\u003e f.as_binary()\n    bytearray(b'!F\\x016\\x01!G\\x016\\x00~\\xfe\\t\\xd2\\x19\\x01!F\\x01~\\x17\\xc2\\x00\\x01\n    \\xff_\\x16\\x00!H\\x01\\x19\\x19Ny#F#\\x96Wx#\\x9e\\xda?\\x01\\xb2\\xca?\\x01Vp+^q+r+s!\n    F\\x014!')\n    \u003e\u003e\u003e list(f.segments)\n    [Segment(address=256, data=bytearray(b'!F\\x016\\x01!G\\x016\\x00~\\xfe\\t\\xd2\\x19\\x01\n    !F\\x01~\\x17\\xc2\\x00\\x01\\xff_\\x16\\x00!H\\x01\\x19\\x19Ny#F#\\x96Wx#\\x9e\\xda?\\x01\n    \\xb2\\xca?\\x01Vp+^q+r+s!F\\x014!'))]\n    \u003e\u003e\u003e f.minimum_address\n    256\n    \u003e\u003e\u003e f.maximum_address\n    320\n    \u003e\u003e\u003e len(f)\n    64\n    \u003e\u003e\u003e f[f.minimum_address]\n    33\n    \u003e\u003e\u003e f[f.minimum_address:f.minimum_address + 1]\n    bytearray(b'!')\n\nSee the `test suite`_ for additional examples.\n\nCommand line tool\n-----------------\n\nThe info subcommand\n^^^^^^^^^^^^^^^^^^^\n\nPrint general information about given binary format file(s).\n\n.. code-block:: text\n\n   $ bincopy info tests/files/in.hex\n   File:                    tests/files/in.hex\n   Data ranges:\n\n       0x00000100 - 0x00000140 (64 bytes)\n\n   Data ratio:              100.0 %\n   Layout:\n\n       0x100                                                      0x140\n       ================================================================\n\nThe convert subcommand\n^^^^^^^^^^^^^^^^^^^^^^\n\nConvert file(s) from one format to another.\n\n.. code-block:: text\n\n   $ bincopy convert -i ihex -o srec tests/files/in.hex -\n   S32500000100214601360121470136007EFE09D219012146017E17C20001FF5F16002148011973\n   S32500000120194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B73214601342199\n   S5030002FA\n   $ bincopy convert -i binary -o hexdump tests/files/in.hex -\n   00000000  3a 32 30 30 31 30 30 30  30 32 31 34 36 30 31 33  |:200100002146013|\n   00000010  36 30 31 32 31 34 37 30  31 33 36 30 30 37 45 46  |60121470136007EF|\n   00000020  45 30 39 44 32 31 39 30  31 32 31 34 36 30 31 37  |E09D219012146017|\n   00000030  45 31 37 43 32 30 30 30  31 46 46 35 46 31 36 30  |E17C20001FF5F160|\n   00000040  30 32 31 34 38 30 31 31  39 37 39 0a 3a 32 30 30  |02148011979.:200|\n   00000050  31 32 30 30 30 31 39 34  45 37 39 32 33 34 36 32  |12000194E7923462|\n   00000060  33 39 36 35 37 37 38 32  33 39 45 44 41 33 46 30  |3965778239EDA3F0|\n   00000070  31 42 32 43 41 33 46 30  31 35 36 37 30 32 42 35  |1B2CA3F0156702B5|\n   00000080  45 37 31 32 42 37 32 32  42 37 33 32 31 34 36 30  |E712B722B7321460|\n   00000090  31 33 34 32 31 39 46 0a  3a 30 30 30 30 30 30 30  |134219F.:0000000|\n   000000a0  31 46 46 0a                                       |1FF.            |\n\nConcatenate two or more files.\n\n.. code-block:: text\n\n   $ bincopy convert -o srec tests/files/in.s19 tests/files/convert.s19 -\n   S00F000068656C6C6F202020202000003C\n   S325000000007C0802A6900100049421FFF07C6C1B787C8C23783C600000386300004BFFFFE5F2\n   S32500000020398000007D83637880010014382100107C0803A64E80002048656C6C6F20776F13\n   S30B00000040726C642E0A003A\n   S32500000100214601360121470136007EFE09D219012146017E17C20001FF5F16002148011973\n   S32500000120194E79234623965778239EDA3F01B2CA3F0156702B5E712B722B73214601342199\n   S5030005F7\n   S70500000000FA\n\nThe pretty subcommand\n^^^^^^^^^^^^^^^^^^^^^\n\nEasy to read Motorola S-Record, Intel HEX and TI TXT files with the\npretty subcommand.\n\n.. image:: https://github.com/eerimoq/bincopy/raw/master/docs/pretty-s19.png\n\n.. image:: https://github.com/eerimoq/bincopy/raw/master/docs/pretty-hex.png\n\n.. image:: https://github.com/eerimoq/bincopy/raw/master/docs/pretty-ti-txt.png\n\nThe fill subcommand\n^^^^^^^^^^^^^^^^^^^\n\nFill empty space between segments. Use ``--max-words`` to only fill\ngaps smaller than given size.\n\n.. code-block:: text\n\n   $ bincopy info tests/files/in_exclude_2_4.s19 | grep byte\n       0x00000000 - 0x00000002 (2 bytes)\n       0x00000004 - 0x00000046 (66 bytes)\n   $ bincopy fill tests/files/in_exclude_2_4.s19 filled.s19\n   $ bincopy info filled.s19 | grep byte\n       0x00000000 - 0x00000046 (70 bytes)\n\nContributing\n============\n\n#. Fork the repository.\n\n#. Install prerequisites.\n\n   .. code-block:: text\n\n      pip install -r requirements.txt\n\n#. Implement the new feature or bug fix.\n\n#. Implement test case(s) to ensure that future changes do not break\n   legacy.\n\n#. Run the tests.\n\n   .. code-block:: text\n\n      make test\n\n#. Create a pull request.\n\nSimilar projects\n================\n\nThese projects provides features similar to bincopy:\n\n- `SRecord`_ (``srec_cat`` and ``srec_info``)\n\n- `IntelHex`_ (Python IntelHex library)\n\n- `objutils`_ (Process HEX files in Python)\n\n.. _test suite: https://github.com/eerimoq/bincopy/blob/master/tests/test_bincopy.py\n\n.. _SRecord: http://srecord.sourceforge.net/\n\n.. _IntelHex: https://github.com/python-intelhex/intelhex\n\n.. _objutils: https://github.com/christoph2/objutils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerimoq%2Fbincopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feerimoq%2Fbincopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerimoq%2Fbincopy/lists"}