mciutil package¶
Subpackages¶
Submodules¶
mciutil.mciutil module¶
mciutil function library
Contains functions to work with MasterCard formatted files
-
mciutil.mciutil.
b
(string)[source]¶ Create a byte string field - Python 2.x
Parameters: string – input string Returns: a byte array containing the string
-
mciutil.mciutil.
block
(unblocked_data)[source]¶ Blocks a list of records to 1014 byte blocked VBS records
Parameters: unblocked_data – list containing records Returns: string containing repeating binary length(4) + data records in a single string including 1014 block markers
-
mciutil.mciutil.
flip_message_encoding
(message, bit_config, source_format)[source]¶ Flip the encoding of an ISO8583 style file between ASCII and EBCDIC
Parameters: - message – The data to be flipped
- bit_config – dictionary of bit mapping configuration
- source_format – The encoding of the source {ebcdic, ascii}
Returns: message encoded
-
mciutil.mciutil.
get_message_elements
(message, bit_config, source_format)[source]¶ Convert ISO8583 style message to dictionary
Parameters: message – The message in ISO8583 based format - Message Type indicator - 4 bytes
- Binary bitmap - 16 bytes (Reads DE1 and DE2)
- Message data - Remainder of record
Parameters: - bit_config – dictionary of bit mapping configuration
- source_format – string indicating encoding of data (ascii|ebcdic)
Returns: dictionary of message elements
- key = ‘MTI’ message type indicator
- key = ‘DEx’ data elements
- key = ‘PDSxxxx’ private data fields
- key = ‘TAGxxxx’ icc fields
-
mciutil.mciutil.
unblock
(blocked_data)[source]¶ Unblocks a 1014 byte blocked string
Parameters: blocked_data – String containing 1014 blocked data or file Returns: list of records in file