Welcome to byteparsing’s documentation!
Byteparsing is a package for mixed text and binary parsing in Python. The main driver for developing this package was to write a parser for binary OpenFOAM files. The binary file format in OpenFOAM is “special”. It is the same as the ASCII based text format, except where large blocks of floating point data are concerned.
When not to use byteparsing:
You just need to parse some text: use pyparsing, it is the industry’s standard.
Do use byteparsing if:
You need to tinker with large binary OpenFOAM files directly from Python.
There is a different package that does not adhere to data standards and hacked together its own mixed ASCII/binary file format. You will have to roll out your own parser. Byteparsing can make this easier.
Coolest feature:
Works with
mmap
andnumpy
! This means you can open the file without reading it entirely into memory, change the NumPy array data and the changes are automatically saved to disk.
- Introduction
- Installation
- Examples of usage
- Advanced examples
- Introduction to Functional Parsing in Python
- Architecture
- Parser grammar
- API Documentation
- Cursors
Cursor
- Exceptions
EndOfInput
Expected
Failure
MultipleFailures
- Parsers
byte_none_of()
char()
char_pred()
check_size()
choice()
construct()
fail()
flush()
flush_decode()
fmap()
get_aux()
ignore()
literal()
many()
many_char()
named_sequence()
optional()
parse_bytes()
pop()
push()
quoted_string()
sep_by()
sequence()
set_aux()
some()
some_char()
some_char_0()
text_literal()
text_one_of()
tokenize()
using_config()
value()
with_config()
array()
binary_value()
- Trampoline
Call
Parser
Trampoline
bind()
parser()