The PTPL
CLI Transcoder is a command-line tool designed to decode .ptpl
files into .xml
and encode .xml
files back into .ptpl
format. This tool is designed for working with PTPL files generated by the MCreator program.
When decoding, the tool:
- Reads the
.ptpl
file as a gzip-compressed archive. - Extracts and decodes the base64-encoded XML content.
- Formats the XML for readability.
- Outputs the result to the console or saves it to a specified file.
When encoding, the tool:
- Reads the XML file.
- Encodes the content into base64.
- Compresses the encoded data using gzip.
- Outputs the result to a
.ptpl
file.
Run the transcoder.py
script with the following syntax:
python transcoder.py [-d | -e] <file_path> [--output <output_path>] [--verbose]
Or download ptpl-transcoder
package from PyPI!
pip install ptpl-transcoder
And replace python transcoder.py
in commands with ptpl-transcoder
!
-d
,--decode
: Decode a.ptpl
file into XML.-e
,--encode
: Encode an XML file into.ptpl
format.<file_path>
: The path to the input file. Use a.ptpl
file for decoding or an XML file for encoding.--output
,-o
: (Optional for decoding) Specify the path to save the output file. If not provided, decoded XML content is printed to the console.--verbose
,-v
: (Optional) Enable verbose output for detailed processing information.
To decode a .ptpl
file and print the result:
python transcoder.py -d example.ptpl
To decode a .ptpl
file and save the XML to output.xml
:
python transcoder.py -d example.ptpl -o output.xml
To encode an XML file and save the .ptpl
to output.ptpl
:
python transcoder.py -e example.xml -o output.ptpl
This tool is intended for use in the PTPL Editor project. PTPL files are generated by the MCreator program.
- Python 3.x
- Required libraries:
argparse
base64
gzip
lxml