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
Built Distribution
File details
Details for the file pycsbinarywriter-0.1.0.tar.gz
.
File metadata
- Download URL: pycsbinarywriter-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f24f8cef28332759081fb71fb15f6486ed04f098f70aab2aafc5e70cdc57c173 |
|
MD5 | b697865aaaf5001a7e09a8207fabe4b9 |
|
BLAKE2b-256 | 60f512d001055637ce7c4fcdb649b07d6d6c553c9861a97b9bf796f644448fe5 |
File details
Details for the file pycsbinarywriter-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pycsbinarywriter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71ccc758bdbd021d0a8ceb024adf9f43aa668e72a6170ae035211e4e98707638 |
|
MD5 | 6412eb2d59186e268d73cb182aea1997 |
|
BLAKE2b-256 | b7f3c262efd1494954220879296af29ddb29841c5454b1fb9e9ae2e6e282caf4 |