pfp
is a python-based interpreter for 010 template scripts.
See the main documentation on Read the Docs
See CONTRIBUTING.md
Install pfp with
pip install --upgrade pfp
pfp -t path/to/template input_file
All available options for the pfp CLI:
usage: pfp [-h] -t TEMPLATE [--show-offsets] [-k] input
Run pfp on input data using a specified 010 Editor template for parsing
positional arguments:
input The input data stream or file to parse. Use '-' for
piped data
optional arguments:
-h, --help show this help message and exit
-t TEMPLATE, --template TEMPLATE
The template to parse with
--show-offsets Show offsets in the parsed data of parsed fields
-k, --keep Keep successfully parsed data on error
This should get you started parsing something using 010 templates:
import pfp
dom = pfp.parse(
data_file="~/Desktop/image.png",
template_file="~/Desktop/PNGTemplate.bt"
)