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()
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
Built Distribution
File details
Details for the file xmi-reader-0.5.9.tar.gz
.
File metadata
- Download URL: xmi-reader-0.5.9.tar.gz
- Upload date:
- Size: 35.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 768e846c0f7a8f6957f8a342ecaf84d8f14aa5e61b27f41e5da190d55222df7f |
|
MD5 | ce360944327c749214bb8111fa568b38 |
|
BLAKE2b-256 | ec4202d997d44edeb82727fc47d0ca85b26ff89467f5db5852c8e408512e6c9f |
File details
Details for the file xmi_reader-0.5.9-py3-none-any.whl
.
File metadata
- Download URL: xmi_reader-0.5.9-py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86813eda0373ff876f8cc9c188b154073b4afac26ae4abfd2b8c7e5b5c8db391 |
|
MD5 | c8cc97f285d16a8be213479deda08b57 |
|
BLAKE2b-256 | 58f3c4f2e473e1b7eb713baa5466dd4791a544d4b71e59927c32674755f2a523 |