{"id":17753102,"url":"https://github.com/knovichikhin/pyiso8583","last_synced_at":"2025-05-08T21:17:11.021Z","repository":{"id":44703426,"uuid":"216466630","full_name":"knovichikhin/pyiso8583","owner":"knovichikhin","description":"ISO8583 protocol parser that creates a regular Python dictionary describing ISO8583 data","archived":false,"fork":false,"pushed_at":"2025-02-08T18:58:18.000Z","size":196,"stargazers_count":58,"open_issues_count":0,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T21:16:58.256Z","etag":null,"topics":["banking","iso8583","library","payments","protocol","python"],"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/knovichikhin.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-10-21T03:05:02.000Z","updated_at":"2025-02-18T10:30:34.000Z","dependencies_parsed_at":"2024-10-26T14:09:12.428Z","dependency_job_id":"030ad570-f0bf-4a9d-bd1b-96aad1d2268e","html_url":"https://github.com/knovichikhin/pyiso8583","commit_stats":{"total_commits":88,"total_committers":1,"mean_commits":88.0,"dds":0.0,"last_synced_commit":"16dca940d8be5c4b6cb1ae4e087220007f135730"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knovichikhin%2Fpyiso8583","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knovichikhin%2Fpyiso8583/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knovichikhin%2Fpyiso8583/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knovichikhin%2Fpyiso8583/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knovichikhin","download_url":"https://codeload.github.com/knovichikhin/pyiso8583/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149622,"owners_count":21861740,"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":["banking","iso8583","library","payments","protocol","python"],"created_at":"2024-10-26T13:07:58.848Z","updated_at":"2025-05-08T21:17:11.000Z","avatar_url":"https://github.com/knovichikhin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"iso8583 - a Python package for parsing ISO8583 data\n===================================================\n\n|pypi| |docs| |coverage|\n\n``iso8583`` package serializes and deserializes ISO8583 data between\nraw ``bytes`` ISO8583 data and a regular Python ``dict``.\n\n``iso8583`` package supports custom `specifications \u003chttps://pyiso8583.readthedocs.io/en/latest/specifications.html\u003e`_\nthat can define:\n\n- Field length and data encoding, such as BCD, ASCII, EBCDIC, etc.\n- Field length count measured in bytes or nibbles.\n- Field type, such as fixed, LLVAR, LLLVAR, etc.\n- Maximum length\n- Optional field description\n\nMultiple specifications can co-exist to support ISO8583 messages for POS, ATM,\nfile actions, and so on. Simply define a new specification dictionary. ``iso8583``\npackage includes a starter specification in ``iso8583.specs`` module that can be\nused as a base to create own custom/proprietary specifications.\n\nAdditional information is available on `Read The Docs \u003chttp://pyiso8583.readthedocs.org\u003e`_.\n\nInstallation\n------------\n\n``iso8583`` is published on `PyPI`__ as ``pyiso8583`` and can be installed from there:\n\n.. code-block::\n\n    pip install pyiso8583\n\n__ https://pypi.org/project/pyiso8583/\n\nEncoding \u0026 Decoding\n-------------------\n\nUse `iso8583.decode \u003chttps://pyiso8583.readthedocs.io/en/latest/functions.html#iso8583.decode\u003e`_\nto decode raw ISO8583 message.\nIt returns two dictionaries: one with decoded data and one with encoded data.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import pprint\n    \u003e\u003e\u003e import iso8583\n    \u003e\u003e\u003e from iso8583.specs import default_ascii as spec\n    \u003e\u003e\u003e encoded_raw = b'02004000000000000000101234567890'\n    \u003e\u003e\u003e decoded, encoded = iso8583.decode(encoded_raw, spec)\n    \u003e\u003e\u003e pprint.pp(decoded)\n    {'t': '0200', 'p': '4000000000000000', '2': '1234567890'}\n    \u003e\u003e\u003e pprint.pp(encoded)\n    {'t': {'len': b'', 'data': b'0200'},\n     'p': {'len': b'', 'data': b'4000000000000000'},\n     '2': {'len': b'10', 'data': b'1234567890'}}\n\nModify the decoded message to send a response back.\nChange message type from '0200' to '0210'.\nRemove field 2 (PAN). And add field 39 (Response Code).\n\n.. code-block:: python\n\n    \u003e\u003e\u003e decoded['t'] = '0210'\n    \u003e\u003e\u003e decoded.pop('2', None)\n    '1234567890'\n    \u003e\u003e\u003e decoded['39'] = '05'\n\nUse `iso8583.encode \u003chttps://pyiso8583.readthedocs.io/en/latest/functions.html#iso8583.encode\u003e`_\nto encode updated ISO8583 message.\nIt returns a raw ISO8583 message and a dictionary with encoded data.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e encoded_raw, encoded = iso8583.encode(decoded, spec)\n    \u003e\u003e\u003e encoded_raw\n    bytearray(b'0210000000000200000005')\n    \u003e\u003e\u003e pprint.pp(decoded)\n    {'t': '0210', 'p': '0000000002000000', '39': '05'}\n    \u003e\u003e\u003e pprint.pp(encoded)\n    {'t': {'len': b'', 'data': b'0210'},\n     'p': {'len': b'', 'data': b'0000000002000000'},\n     '39': {'len': b'', 'data': b'05'}}\n\nPretty Print Messages\n---------------------\n\nUse `iso8583.pp \u003chttps://pyiso8583.readthedocs.io/en/latest/functions.html#iso8583.pp\u003e`_\nto pretty print ISO8583 message.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import iso8583\n    \u003e\u003e\u003e from iso8583.specs import default_ascii as spec\n    \u003e\u003e\u003e encoded_raw = b'02004000000000000000101234567890'\n    \u003e\u003e\u003e decoded, encoded = iso8583.decode(encoded_raw, spec)\n    \u003e\u003e\u003e iso8583.pp(decoded, spec)\n    t   Message Type                  : '0200'\n    p   Bitmap, Primary               : '4000000000000000'\n    2   Primary Account Number (PAN)  : '1234567890'\n    \u003e\u003e\u003e iso8583.pp(encoded, spec)\n    t   Message Type                  : b'0200'\n    p   Bitmap, Primary               : b'4000000000000000'\n    2   Primary Account Number (PAN)  : b'10' b'1234567890'\n\nContribute\n----------\n\n``iso8583`` package is hosted on `GitHub \u003chttps://github.com/knovichikhin/pyiso8583\u003e`_.\n\nFeel free to fork and send contributions over.\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pyiso8583.svg\n    :alt: PyPI\n    :target:  https://pypi.org/project/pyiso8583/\n\n.. |docs| image:: https://readthedocs.org/projects/pyiso8583/badge/?version=latest\n    :alt: Documentation Status\n    :target: https://pyiso8583.readthedocs.io/en/latest/?badge=latest\n\n.. |coverage| image:: https://codecov.io/gh/knovichikhin/pyiso8583/branch/master/graph/badge.svg\n    :alt: Test coverage\n    :target: https://codecov.io/gh/knovichikhin/pyiso8583\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknovichikhin%2Fpyiso8583","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknovichikhin%2Fpyiso8583","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknovichikhin%2Fpyiso8583/lists"}