Skip to main content

Unpacking from bytes and packing into bytes, with an object interface.

Project description

ByteStory

Unpacking from bytes and packing into bytes, with an object interface.

Install

pip install bytestory

Usage

Unpacking from bytes

import bytestory

class OneByte(bytestory.ByteStory):
    a = bytestory.Char

one_byte = OneByte(b'\x11')

assert one_byte.a == 0x11

Packing into bytes

import bytestory

class OneByte(bytestory.ByteStory):
    a = bytestory.Char

one_byte = OneByte(a=0x11)

assert one_byte.pack() == b'\x11'

More examples at tests/test_bytestory.py.

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

bytestory-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bytestory-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file bytestory-0.1.0.tar.gz.

File metadata

  • Download URL: bytestory-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/4.4.0-19041-Microsoft

File hashes

Hashes for bytestory-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e17bf49e8b2e9192747b143b6fa798d007cea005b5eee54d7dfce4b506c7cff6
MD5 840cf30b8828a81c39638c6ff3d13084
BLAKE2b-256 ddc31deb82878e07d23da47881e39ac56d7c8cbce62425a77453e4e280fcc8b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bytestory-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/4.4.0-19041-Microsoft

File hashes

Hashes for bytestory-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3354d1575c05cfd811d9e9f9186c38548161a1b36edd89bd8a56eea407ed61b5
MD5 6f3d5edf4bd863c10ae21e919b6ab435
BLAKE2b-256 6c08d2b2b7f81b0251cd421a5c5e2d56205245b1695aee19cfc6c139b79cee82

See more details on using hashes here.

Supported by

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