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 load classes and built-in types.
Use the package manager pip to install pyparcel:
pip install pyparcel
or using pipenv:
pipenv install pyparcel
import pyparcel
foo: Foo = Foo(8, 5.7, "Hello World") # Foo(int, float, str)
data: bytes = pyparcel.load(foo) # b'\x08\x00\x00\x00ff\xb6@\x0b\x00\x00\x00Hello World'
# ...
bar: Foo = Foo()
pyparcel.unload(data, bar) # foo == bar
# or
baz: Foo = pyparcel.unload(data, Foo()) # foo == baz
This repository follows a "fork-and-pull" workflow. If you would like to contribute perform the following:
- Fork the repostiory to your Github.
- Clone your fork to your local machine.
- Checkout a new branch with a meaningful name.
- Commit your changes to your fork.
- 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.