Skip to main content

NETDATA, AWSTAPE and HET File Python Library

Open and extract (unload) XMI/AWS/HET mainframe files.

Installation

You can install the xmi library from PyPI using:

python3 -m pip install xmilib

How to Use

The most simple way to use this library is to import this module and use xmi.open_file() to open an XMI, AWS, or HET file::

import xmi
xmi_obj = xmi.open_file("/path/to/file.xmi")
het_obj = xmi.open_file("/path/to/file.het")
aws_obj = xmi.open_file("/path/to/file.aws")

To list all datasets and dataset members::

for f in het_obj.get_files():
    if het_obj.is_pds(f):
        for m in het_obj.get_members(f):
            print("{}({})".format(f, m))
    else:
        print(f)

Print JSON metatdata::

print(xmi_obj.get_json())
print(het_obj.get_json(text=True)) # Adds plaintext files to json output
print(aws_obj.get_json(indent=6)) # Increases the json indent

Silently extract all files/folders to /tmp/xmi_files/::

aws_obj.set_output_folder("/tmp/xmi_files/")
aws_obj.set_quiet(True)
aws_obj.extract_all()

Print detailed file information::

xmi_obj.print_details()
xmi_obj.print_xmit()  # Same output as previous, print_xmit() is an alias to print_details()
het_obj.print_tape()  # print_tape() is an alias to print_details()
aws_obj.print_tape(human=True)  # Converts size to human readable

Print message:

if xmi_obj.has_message():
    print(xmi_obj.get_message())

# or just
print(xmi_obj.get_message())  # Prints 'None' if no message

If you you're having problems with the library or want to see whats happening behind the scenes you can enable debugging:

import logging
import xmi

xmi_obj = xmi.XMIT(filename="/path/to/file.xmi",loglevel=logging.DEBUG)
xmi_obj.open()

Command-line tools

After pip install xmilib three commands are available in your PATH.

extractxmi — open, list and extract XMI / AWS / HET files:

extractxmi -l FILE.XMI                        # list contents
extractxmi FILE.XMI                           # extract everything
extractxmi FILE.XMI "MY.PDS(MEMBER)"          # extract one member
extractxmi -pH FILE.XMI                       # print detailed metadata
extractxmi FILE.XMI --outputdir /tmp/out/     # extract to a folder
extractxmi --help                             # full option list

createxmi — create an XMI file from a local file or folder:

createxmi myfolder/                                       # folder → PDS XMI
createxmi myfolder/ -o MY.XMI --dsn MY.PDS               # set output & DSN
createxmi myfolder/ -o MY.XMI --from-user IBMUSER        # set ISPF owner
createxmi myfile.jcl -o SEQ.XMI --dsn MY.SEQ             # file → sequential XMI
createxmi xmi_folder/ -o MULTI.XMI --dsn MULTI.PDS       # XMI-in-XMI container
createxmi --help                                          # full option list

mvsfile identifies MVS binary formats that file reports as data. These include load modules, object decks (OBJ/XOBJ), GOFF, IEBCOPY unloads, TERSE, SMF, program objects and AWS/HET virtual tapes (also when they are members of an XMI or files on another tape). Extracted members get a matching extension (.lmd, .obj, .gof, ...) and an mvs_format field. See docs/formats.rst.

mvsfile DAF.bin                   # DAF.bin: MVS load module (unloaded PDS member, RECFM=U) (high)
mvsfile -v DAF.bin                # parsed details (CSECTs, AMODE/RMODE, IDR) as JSON

More Information

Metadata

Release files for xmilib 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xmilib 1.2.1
File Size Uploaded Provenance Actions
xmilib-1.2.1.tar.gz 102.6 kB With provenance Details for xmilib-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xmilib 1.2.1
File Interpreter ABI Platform Actions
xmilib-1.2.1-py3-none-any.whl Python 3 none any Details for xmilib-1.2.1-py3-none-any.whl

Total release size: 182.3 kB

Release files / xmilib-1.2.1.tar.gz

Download URL xmilib-1.2.1.tar.gz
Size 102.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8171bfc9735bddaab9ce14de32e4bc102d8c85f7633585708cb81887ac852e01
BLAKE2b-256 checksum
How to use checksums
28d1031c04222aa6feeb3f758f63acd62182fe6d69e7ac9b4b5c0407b2c9fc81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / xmilib-1.2.1-py3-none-any.whl

Download URL xmilib-1.2.1-py3-none-any.whl
Size 79.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c70e1023d41e59a90ca6fa07c1ed5717a556b0e8f0c79be4e0222c20a29fddd1
BLAKE2b-256 checksum
How to use checksums
b41e79c0aceebaeb1f695c52f099fa814930f6d9a02c06df520eac80c1cfba26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for xmilib 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xmilib-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page