Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmi_reader-1.0.3.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmi_reader-1.0.3-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file xmi_reader-1.0.3.tar.gz.

File metadata

  • Download URL: xmi_reader-1.0.3.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xmi_reader-1.0.3.tar.gz
Algorithm Hash digest
SHA256 ee28ce4a3969233bbebf5a6e09c4e09d3ccd4da7432ab2a0f82718ec170ef6f5
MD5 64a462c9f09f377bbde5c43883f9b06e
BLAKE2b-256 9ce2d00607b61b48738c7b529a63da7f5cfc4ccdeeba2adf5478fd133a1a8196

See more details on using hashes here.

File details

Details for the file xmi_reader-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: xmi_reader-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 49.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xmi_reader-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61f6709cbb1cb5d2a96cace57c3a362d3e75706e359c1a9bf81d77a11612cd8e
MD5 b58e6cd2cc481325e5cab96cb6c382df
BLAKE2b-256 492b4fb6f7971d96b649d487153f7b468435aba014cf99318766d3d811e44e1b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page