Skip to main content

Easy to use binary packer that doesn't require struct's specifications

Project description

pyparcel

pyparcel is a Python library to easily perform conversions between Python values and C structs represesented as Python bytes objects. pyparcel extends the usage of struct and provides a simpler way to pack classes.

Installation

Use the package manager pip to install foobar.

pip install pyparcel

Usage

import pyparcel

foo: Foo = Foo(8, 5.7, "Hello World") # Foo(int, float, str)
data: bytes = pyparcel.pack(foo) # b'\x08\x00\x00\x00ff\xb6@\x0b\x00\x00\x00Hello World'

# ...

bar: Foo = Foo()
pyparcel.unpack(data, bar) # foo == bar
# or
baz: Foo = pyparcel.unpack(data, Foo()) # foo == baz

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

pyparcel-0.0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

pyparcel-0.0.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pyparcel-0.0.4.tar.gz.

File metadata

  • Download URL: pyparcel-0.0.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for pyparcel-0.0.4.tar.gz
Algorithm Hash digest
SHA256 fb7dce6e6085f9ab15b47b4e2b475c647af5c18186b65264a98fcae563231378
MD5 dd814ecca39f2703a9e0cbf5357df95e
BLAKE2b-256 eb9cfd9fd8544cbbaf2dba9a0ce2fcea53c40b45597ae09e60ebdef44840d8ce

See more details on using hashes here.

File details

Details for the file pyparcel-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyparcel-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for pyparcel-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0db2e1fae28ba5066348008841ea0cbb8ffdfbfcbdfc83022f2a94dc17a6a202
MD5 6186549db810956e3c68da7b8dc5178d
BLAKE2b-256 7171722d33af1e97df536ed2705cce10944f0ef698f5e7b74af035b12118be7f

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