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.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

bytesioex-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file bytesioex-0.1.1.tar.gz.

File metadata

  • Download URL: bytesioex-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.11.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for bytesioex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 efccaeae22da665f11ee52451eeda4912dbf512386948735ea37823513f23ea4
MD5 3625e071ddbfb60dea40677840be594e
BLAKE2b-256 f0e376162049a21d8fc0da7c96830a06f9f8f115acdb17606f50fe7f24c3e87e

See more details on using hashes here.

File details

Details for the file bytesioex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bytesioex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.11.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for bytesioex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16aad3bc2cd62dcd082a414a57e6d36e114b10ed504e49dd6c3305ccdc318f7e
MD5 2c1bee68f9a3c16e3ef49f1c87de17be
BLAKE2b-256 b7329ba22248806dfd42b434584b84adcab0ab65d6aa523849992a81f919fa5f

See more details on using hashes here.

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