pyiso8583 is a Python package designed for serializing and deserializing ISO8583 data. It converts raw ISO8583 byte streams into Python dictionaries and vice-versa, supporting various custom specifications for field lengths, data encoding (like BCD, ASCII, EBCDIC), and field types (fixed, LLVAR, LLLVAR). The current version is 4.0.1, with releases typically occurring a few times a year, indicating active development.
pip install pyiso8583Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to decode a raw ISO8583 message using the default_ascii specification, modify some fields, and then encode it back into a raw bytearray. It uses `iso8583.decode` and `iso8583.encode` functions.
Consult the official 'Change Log' on Read the Docs for specific migration steps. Test your application thoroughly after upgrading.
Refer to the 'Specifications' section in the documentation (iso8583.specs module) for detailed guidance on creating and validating custom specifications. Pay close attention to `len_count`, `data_enc`, `left_pad`, and `right_pad` for complex field types.
When defining fields with `data_enc` set to 'b' (binary/BCD) and `len_count` set to 'nibbles', ensure you explicitly define either `left_pad` or `right_pad` with the appropriate padding digit (0-F).
Verify the integrity of the incoming raw ISO8583 message. Check your `spec` dictionary, particularly the `max_len` and `len_type` properties for the reported field, to ensure they correctly match the message format.
Review the data being assigned to the field in your Python dictionary (`doc_dec`) and compare it against the `max_len`, `len_type`, and `data_enc` defined for that field in your `spec` dictionary. Adjust the data or the specification to ensure they are compatible.
Ensure that the first argument to `iso8583.encode()` is always a dictionary containing the ISO8583 field data.
Ensure that the first argument to `iso8583.decode()` is always a `bytes` or `bytearray` object representing the raw ISO8583 message.
No dependency data recorded yet.