Skip to main content

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)

Uploaded Source

Built Distribution

pycsbinarywriter-0.1.1-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page