Skip to main content

A Python library offering a more concise syntax for data packing.

Project description

StructOvO

A Python library offering a more concise syntax for data packing.

Usage

from structovo import *


class PackA(Pack):
    a: PADDING
    b: BYTE = b'A'
    c: CHAR = -1
    d: UCHAR = 1
    e: BOOL = False
    f: SHORT = -2
    g: USHORT = 2
    h: INT = -3
    i: UINT = 3
    j: LONG = -4
    k: ULONG = 4
    l: LONGLONG = -5
    m: ULONGLONG = 5
    n: SIZET = 12
    o: SSIZET = 34
    p: BINARY16 = 3.14
    q: FLOAT = 3.14
    r: DOUBLE = 3.14
    s: FixedString = (b"hello", 10)
    t: LengthPrefixedString = b"world"
    u: UnsignedPointer = 0x0d000721


r = PackA.build(endianness=Endianness.NATIVE)
print(r)

And you will get:

b'\x00A\xff\x01\x00\xfe\xff\x02\x00\xfd\xff\xff\xff\x03\x00\x00\x00\xfc\xff\xff\xff\x04\x00\x00\x00\xfb\xff\xff\xff\xff\xff\xff\xff\x05\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00"\x00\x00\x00\x00\x00\x00\x00HB\xc3\xf5H@\x1f\x85\xebQ\xb8\x1e\t@hello\x00\x00\x00\x00\x00\x05world!\x07\x00\r\x00\x00\x00\x00'

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

structovo-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

structovo-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: structovo-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for structovo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73e33ed4efc7cc0e8148dd6d99b24a98b6bc0cc0258f07b5ed5486903311d3f3
MD5 ba796e1ed7e4ef2593c04d848ad73095
BLAKE2b-256 baaf7a8a26d9ac8ee46862ca85f46ae06fec05f89063c7f2d5d793514ed3529c

See more details on using hashes here.

Provenance

The following attestation bundles were made for structovo-0.1.0.tar.gz:

Publisher: release.yml on GuangChen2333/StructOvO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: structovo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for structovo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d84a78804af505d248f419a374be683c5225352669422676a8743825481ceb5
MD5 45f93d5eff9143e75a7bf0372eb0fb7d
BLAKE2b-256 bf553a7119adcb7621c908e584e9fe7a5efeddf68ed32e881b1ecdfc42076db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for structovo-0.1.0-py3-none-any.whl:

Publisher: release.yml on GuangChen2333/StructOvO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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