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())
If you you're having problems with the library or want to see whats happeneing 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()
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-0.5.6.tar.gz
(28.8 kB
view hashes)
Built Distribution
xmi_reader-0.5.6-py3-none-any.whl
(34.7 kB
view hashes)
Close
Hashes for xmi_reader-0.5.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8b6507b1f39248289d74edb27be919b04c279fed26a898f6ee96e882956bd42 |
|
MD5 | 0bf2523826b51d7d9819f43ea32517a8 |
|
BLAKE2b-256 | 9997fd61da6b47c90003bc4c7933f04f5a6c328d3dec52e9fa40cb7f267033ca |