Helpers for parsing and writing binary data created by dotnet System.IO.BinaryWriters.
Project description
pyCSBinaryWriter
A simple library for .NET binary (de)serialization.
This package gives developers access to simple method calls from decoding binary data written by .NET BinaryWriter.
Limitations
- Decimal is not implemented yet. Pull requests are welcome.
- asyncio support is brand new and may be buggy.
Installation
$ pip install -U pycsbinarywriter
Usage
from pycsbinarywriter import cstypes
# Decode .NET 7-bit-prefixed string
assert 'abc123' == cstypes.string.unpack(b'\x06\x61\x62\x63\x31\x32\x33')
# Decode .NET uint8 (ubyte)
assert 127 == cstypes.uint8.unpack(b'\x7f')
# Encode .NET int16
assert b'\x2e\xfb' == cstypes.int16.pack(-1234)
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycsbinarywriter-0.1.1.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for pycsbinarywriter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38e95d84a72ba1030340f0efabe58adc7c35abf66ab7289255c8cb3d729bfc51 |
|
MD5 | 45b2beba4514c181d1b1e7e1942d21c8 |
|
BLAKE2b-256 | b4fa986a57f8c757ac79aeba91aa358c63b2460dfb86e86c48a6cdc23e574a9c |