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 and numpy! 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.

Indices and tables