Skip to main content

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

Project description

pyparcel

Build Status Downloads

pyparcel is the simple and secure way to convert python objects to bytestrings. pyparcel extends the usage of struct and provides a simpler way to pack classes and built-in types.

Installation

Use the package manager pip to install pyparcel:

pip install pyparcel

or using pipenv:

pipenv 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

This repository follows a "fork-and-pull" workflow. If you would like to contribute perform the following:

  1. Fork the repostiory to your Github.
  2. Clone your fork to your local machine.
  3. Checkout a new branch with a meaningful name.
  4. Commit your changes to your fork.
  5. Submit a pull request with a description of changes and enhancements made for further review.

Check out some issues to work on in the issues section.

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.22.tar.gz (5.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pyparcel-0.9.22.tar.gz
Algorithm Hash digest
SHA256 37092d4bd402fbfd3035c3180b49c1bd24bf0c2576a922fd1d9104a5a4d58a27
MD5 7d8a7855046405591e7772b5f6720067
BLAKE2b-256 d5137b413ce35e7511d436276a5c385465bacbc7edfa81b398d8a9cf29f74efd

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