Skip to main content

A simple wrapper over io.BytesIO which allows reading and writing C data types

Project description

BytesIOEx

PyPI PyPI - Python Version Code Style: Black security: bandit

BytesIOEx is a simple wrapper over Python's io.BytesIO which provides additional methods for reading and writing C data types like int8, uint8, bool and so on. The read_* methods are used for reading a particular type from the stream and the write_* methods are used for writing Python's basic data types int, bool and float to the stream. Both these types of methods advance the steam position by the size of the data type. The type conversion is handled by the struct module. Struct classes are used to maximize the performance. Native byteorder is used.

⏬ Installation

BytesIOEx requires Python 3.6+, it may run on older version as well but I have not tested it.

pip install --upgrade bytesioex

📜 Documentation

Docs are available on ReadTheDocs.

🚀 Roadmap

  • Ensure full coverage.
  • Add wchar (UTF-16 character) support.
  • Support for different byte orders.

❕ Motivation

C# BinaryReader and BinaryWriter.

📧 Contact

E-mail: demberto@protonmail.com

© License

BytesIOEx is distributed under the 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

bytesioex-0.1.2.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

bytesioex-0.1.2-py3-none-any.whl (4.7 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