### Install cardutil for development Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Clone the cardutil repository and install it in editable mode with test dependencies. Use a virtual environment to avoid polluting the system Python installation. ```default $ git clone https://github.com/adelosa/cardutil.git $ pip install -e ."[test]" ``` -------------------------------- ### Build documentation Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Install documentation dependencies and build the HTML documentation. Use the Windows command on Windows systems. Ensure you install with -e to reflect source changes. ```default $ pip install -e ".[docs]" $ make html -C ./docs WINDOWS> docs\make.bat html -C docs $ open ./docs/build/html/index.html ``` -------------------------------- ### Example cardutil configuration JSON Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Example JSON configuration for cardutil tools. The configuration includes bit_config and output_data_elements arrays, plus mci_parameter_tables defining field positions for IPM parameter tables. This is an example only; refer to cardutil.config for full details. ```json { "bit_config": { "1": {"field_name": "Bitmap secondary", "field_type": "FIXED", "field_length": 8}, "other bits": {}, "127": {"field_name": "Network data", "field_type": "LLLVAR", "field_length": 0} }, "output_data_elements": [ "MTI", "DE2", "DE3", "DE4", "DE12", "DE14", "DE22", "DE23", "DE24", "DE25", "DE26", "DE30", "DE31", "DE33", "DE37", "DE38", "DE40", "DE41", "DE42", "DE48", "DE49", "DE50", "DE63", "DE71", "DE73", "DE93", "DE94", "DE95", "DE100", "PDS0023", "PDS0052", "PDS0122", "PDS0148", "PDS0158", "PDS0165", "DE43_NAME", "DE43_SUBURB", "DE43_POSTCODE", "ICC_DATA" ], "mci_parameter_tables": { "IP0006T1": { "card_program_id": {"start": 19, "end": 22}, "data_element_id": {"start": 22, "end": 25}, "data_element_name": {"start": 25, "end": 82}, "data_element_format": {"start": 82, "end": 85} } } } ``` -------------------------------- ### Install cardutil with pip Source: https://github.com/adelosa/cardutil/blob/master/docs/source/api.rst Install the cardutil package from PyPI using pip. ```default $ pip install cardutil ``` -------------------------------- ### Run unit tests Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Run the unit tests for the project. ```default $ pytest ``` -------------------------------- ### Release a new version Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Bump the version and push tags. Ensure the source tree is clean before performing this process. ```bash $ bumpversion (patch|minor|major) $ git push --follow-tags ``` -------------------------------- ### mci_ipm_param_to_csv usage text Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Shows the command-line usage and options for mci_ipm_param_to_csv. Use this to understand the required positional arguments (in_filename, table_id) and available optional flags such as --no1014blocking, --expanded, and --config-file. ```text usage: mci_ipm_param_to_csv [-h] [-o OUT_FILENAME] [--in-encoding IN_ENCODING] [--out-encoding OUT_ENCODING] [--no1014blocking] [--expanded] [--config-file CONFIG_FILE] [--version] in_filename table_id Mastercard IPM parameter file to CSV positional arguments: in_filename IPM Parameter file to process table_id Parameter table to extract optional arguments: -h, --help show this help message and exit -o OUT_FILENAME, --out-filename OUT_FILENAME --in-encoding IN_ENCODING --out-encoding OUT_ENCODING --no1014blocking --expanded --config-file CONFIG_FILE File containing cardutil configuration - JSON format --version show program's version number and exit ``` -------------------------------- ### Generate coverage report Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Measure test coverage, generate a report, and open the HTML coverage report. ```default $ coverage run -m pytest $ coverage report -m $ coverage html $ open htmlcov/index.html ``` -------------------------------- ### Run unit tests with debug output Source: https://github.com/adelosa/cardutil/blob/master/docs/source/contributing.rst Run unit tests with debug messages displayed. ```default $ pytest --log-cli-level=10 ``` -------------------------------- ### mci_csv_to_ipm usage Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Usage for creating a Mastercard IPM file from a CSV file. Date parsing depends on python-dateutil, Python 3.7+, or a simple parser. Warning: do not mix PDS fields and DE fields that contain PDS fields. ```text usage: mci_csv_to_ipm [-h] [-o OUT_FILENAME] [--in-encoding IN_ENCODING] [--out-encoding OUT_ENCODING] [--no1014blocking] [--config-file CONFIG_FILE] [--version] in_filename CSV to Mastercard IPM positional arguments: in_filename optional arguments: -h, --help show this help message and exit -o OUT_FILENAME, --out-filename OUT_FILENAME --in-encoding IN_ENCODING --out-encoding OUT_ENCODING --no1014blocking --config-file CONFIG_FILE File containing cardutil configuration - JSON format --version show program's version number and exit ``` -------------------------------- ### mci_ipm_param_encode usage Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Usage for changing the encoding of a Mastercard IPM parameter file. Supports input and output formats vbs or 1014. ```text usage: mci_ipm_param_encode [-h] [-o OUT_FILENAME] [--in-encoding IN_ENCODING] [--out-encoding OUT_ENCODING] [--no1014blocking] [--in-format {vbs,1014}][--out-format {vbs,1014}] [--version] in_filename Mastercard IPM param file encoder positional arguments: in_filename optional arguments: -h, --help show this help message and exit -o OUT_FILENAME, --out-filename OUT_FILENAME --in-encoding IN_ENCODING --out-encoding OUT_ENCODING --no1014blocking --in-format {vbs,1014} --out-format {vbs,1014} --version show program's version number and exit ``` -------------------------------- ### mci_ipm_to_csv usage Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Usage for converting Mastercard IPM files to CSV. Default input encoding is latin-1. Datetime fields are rendered as ISO 8601 calendar dates. ```text usage: mci_ipm_to_csv [-h] [-o OUT_FILENAME] [--in-encoding IN_ENCODING] [--out-encoding OUT_ENCODING] [--no1014blocking] [--config-file CONFIG_FILE] [--version] in_filename Mastercard IPM to CSV positional arguments: in_filename optional arguments: -h, --help show this help message and exit -o OUT_FILENAME, --out-filename OUT_FILENAME --in-encoding IN_ENCODING --out-encoding OUT_ENCODING --no1014blocking --config-file CONFIG_FILE File containing cardutil configuration - JSON format --version show program's version number and exit ``` -------------------------------- ### mci_ipm_encode usage Source: https://github.com/adelosa/cardutil/blob/master/docs/source/cli.rst Usage for changing the encoding of a Mastercard IPM file. Supports input and output formats vbs or 1014. ```text usage: mci_ipm_encode [-h] [-o OUT_FILENAME] [--in-encoding IN_ENCODING] [--out-encoding OUT_ENCODING] [--no1014blocking] [--in-format {vbs,1014}][--out-format {vbs,1014}] [--version] in_filename Mastercard IPM file encoder positional arguments: in_filename optional arguments: -h, --help show this help message and exit -o OUT_FILENAME, --out-filename OUT_FILENAME --in-encoding IN_ENCODING --out-encoding OUT_ENCODING --no1014blocking --in-format {vbs,1014} --out-format {vbs,1014} --version show program's version number and exit ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.