Skip to main content

Read and write not only bytes in python (like DataStream in java)

Project description

datastream

Read and write binary files by integer, floats, strings with fixed size.

Installing

pip install python-datastream

Usage

Reading:

from datastream import DataInputStream

with open("test.bin", "rb") as f:
    ds = DataInputStream(f)
    print(ds.read_int())
    print(ds.read_strz())

Writing:

from datastream import DataOutputStream

with open("test.bin", "wb") as f:
    ds = DataOutputStream(f)
    ds.write_int(42)
    ds.write_strz("Hello world")

License

MIT License. See LICENSE file.

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

python-datastream-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

python_datastream-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file python-datastream-0.1.0.tar.gz.

File metadata

  • Download URL: python-datastream-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.0

File hashes

Hashes for python-datastream-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69313fb6a8be514eb99ad28e39a29518c869544a8889830645ad30b4bc686788
MD5 5bda5600e058875b02eb3d4cde2a764a
BLAKE2b-256 27aa402cc46b3af6f81e6696a63a8700d1b37abcb8ede16e80e6c1f0a5bf8be7

See more details on using hashes here.

File details

Details for the file python_datastream-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_datastream-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 637865dba6345f9dd34afae9dc0cb0ec7cfec9890657121f061a8d4c950159b6
MD5 d57e0cb2e050cb854cfb0d77794567e6
BLAKE2b-256 b7cf71b79a5c47664789d1068b32477aa292e7aade554f9d19e370dc27417b57

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