TerseLib ======== An open-source, pure-Python implementation of the z/OS **TERSE** compression format (AMATERSE / TRSMAIN), supporting the PACK (LZW) and SPACK (LZMW) methods, host and native containers, fixed and variable record formats, and text (EBCDIC ⇄ ASCII) or binary rendering with selectable code pages. Files compressed with TerseLib unpack with ``AMATERSE`` on z/OS, and data sets tersed on the mainframe decompress byte-identically here. .. toctree:: :maxdepth: 2 :caption: Contents usage api Quick start ----------- .. code-block:: python import terselib blob = terselib.compress(b"HELLO\nWORLD\n", text=True) result = terselib.decompress(blob) # auto-detects text/binary assert result.data == b"HELLO\nWORLD\n" Command line: .. code-block:: console $ terse report.txt # compress (SPACK, text, variable records) $ unterse DATA.TRS # decompress with content auto-detection $ unterse -i DATA.TRS # inspect the header Indices and tables ------------------ * :ref:`genindex` * :ref:`modindex` * :ref:`search`