Skip to main content

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

Project description

pyparcel

Build Status

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.

Documentation is available at https://najaco.github.io/pyparcel/

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.9.0.tar.gz (6.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.9.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyparcel-0.9.0.tar.gz
  • Upload date:
  • Size: 6.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.9.0.tar.gz
Algorithm Hash digest
SHA256 6ae69b66ab5b34354be1846c7473ca146d735c497265a1bdcaa627c413073d33
MD5 def5372832a97286ba3b6ab60428c4d9
BLAKE2b-256 a34b717ff5e02017af83687fcda10385d4a02b0b05af94ebd4f824bda0e07bef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyparcel-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8182d70f1700efb31f151e89fbd78a822b696c549370bcdbb2d220ad22e3e986
MD5 ece9e3b330385d98bb631eb82bacb1be
BLAKE2b-256 2943578981c25dc985accf5e2f9ec751048ae663553c5a5278cd7072440ddfca

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