https://github.com/d0c-s4vage/pfp
pfp - Python Format Parser - a python-based 010 Editor template interpreter
https://github.com/d0c-s4vage/pfp
010editor binary-data dataparsing interpreter python
Last synced: about 1 year ago
JSON representation
pfp - Python Format Parser - a python-based 010 Editor template interpreter
- Host: GitHub
- URL: https://github.com/d0c-s4vage/pfp
- Owner: d0c-s4vage
- License: mit
- Created: 2015-03-26T10:27:05.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T05:02:06.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T12:08:38.116Z (about 1 year ago)
- Topics: 010editor, binary-data, dataparsing, interpreter, python
- Language: Python
- Homepage:
- Size: 16.8 MB
- Stars: 195
- Watchers: 18
- Forks: 37
- Open Issues: 49
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://travis-ci.org/d0c-s4vage/pfp)
[](https://pypistats.org/packages/pfp)
[](https://pypi.python.org/pypi/pfp/)
[](https://pfp.readthedocs.io/en/latest/)
[](https://coveralls.io/github/d0c-s4vage/pfp?branch=master)
[](https://twitter.com/d0c_s4vage)
# pfp
`pfp` is a python-based interpreter for 010 template scripts.
See the main documentation on [Read the Docs](http://pfp.readthedocs.org/en/latest/)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## Installation
Install pfp with
pip install --upgrade pfp
## Tl;DR
### CLI
```bash
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
```
### Python Library
This should get you started parsing something using 010 templates:
```python
import pfp
dom = pfp.parse(
data_file="~/Desktop/image.png",
template_file="~/Desktop/PNGTemplate.bt"
)
```