Simple library for de/serializing binary data
Project description
binpi
binpi aims to provide a simple interface for serializing and deserializing binary file formats.
Usage:
import binpi
class FileHeader:
prop1: binpi.LEInt()
prop2: binpi.LEShort()
prop3: binpi.LEByte()
some_data: binpi.List(binpi.LEByte(), size="prop1")
# deserializing
header_data = binpi.deserialize(FileHeader, binpi.FileReader("./some_path"))
# modify
header_data.prop2 = 200
# serializing
binpi.serialize(header_data, binpi.FileWriter("./another_path"))
For more examples, check ./examples/
How to install:
pip install binpi
Supported Types:
- LEInt, LEUInt, LEShort, LEUShort, LEByte, LEUByte, LEFloat, LEDouble
- BEInt, BEUInt, BEShort, BEUShort, BEByte, BEUByte, BEFloat, BEDouble
- List, String
TODO:
- Tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
binpi-0.1.6.tar.gz
(4.4 kB
view hashes)
Built Distribution
binpi-0.1.6-py3-none-any.whl
(5.2 kB
view hashes)