Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days 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 (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T05:02:06.000Z (over 1 year ago)
- Last Synced: 2025-01-12T06:05:22.898Z (14 days ago)
- Topics: 010editor, binary-data, dataparsing, interpreter, python
- Language: Python
- Homepage:
- Size: 16.8 MB
- Stars: 196
- Watchers: 19
- 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
[![Master Build Status](https://travis-ci.org/d0c-s4vage/pfp.svg?branch=master)](https://travis-ci.org/d0c-s4vage/pfp)
[![PyPI Statistics](https://img.shields.io/pypi/dm/pfp)](https://pypistats.org/packages/pfp)
[![Latest Release](https://img.shields.io/pypi/v/pfp)](https://pypi.python.org/pypi/pfp/)
[![Documentation Status](https://readthedocs.org/projects/pfp/badge/?version=latest)](https://pfp.readthedocs.io/en/latest/)
[![Coverage Status](https://coveralls.io/repos/github/d0c-s4vage/pfp/badge.svg?branch=master)](https://coveralls.io/github/d0c-s4vage/pfp?branch=master)[![Twitter Follow](https://img.shields.io/twitter/follow/d0c_s4vage?style=plastic)](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] inputRun 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 dataoptional 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 pfpdom = pfp.parse(
data_file="~/Desktop/image.png",
template_file="~/Desktop/PNGTemplate.bt"
)
```