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 xmi-reader

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 xmi-reader two 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

More Information

Release files for xmi-reader 1.0.5

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

Source distribution (sdist)

Source distribution for xmi-reader 1.0.5
File Size Uploaded
xmi_reader-1.0.5.tar.gz 58.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xmi-reader 1.0.5
File Interpreter ABI Platform
xmi_reader-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 108.1 kB

Release files / xmi_reader-1.0.5.tar.gz

Download URL xmi_reader-1.0.5.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b24b8dc5b152796d578fe9ab32ab86244b6cade3c18aab1eeff9cb337c5e9fa
BLAKE2b-256 checksum
How to use checksums
1fee8a5cc94cf5abd022189059f3373289d251f25305b14c230e967f5959804c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / xmi_reader-1.0.5-py3-none-any.whl

Download URL xmi_reader-1.0.5-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e35cac9d9f2af8503ffabbecc2d965ab0296620d52e7cf68d0a906ec8195233b
BLAKE2b-256 checksum
How to use checksums
53abd5e71131cb0391b3d5cf3a2a3e66c203199a2b3bbd9582152efda1b56ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.2

2 release files

0.5.0

1 release file

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