Easy to use binary packer that doesn't require struct's specifications
Project description
pyparcel
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.
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.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
Contributing
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.
Documentation is available at https://najaco.github.io/pyparcel/
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyparcel-1.0.0.tar.gz.
File metadata
- Download URL: pyparcel-1.0.0.tar.gz
- Upload date:
- Size: 6.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d32206418a1680a1f5d3e754e5f82a3a453df3d2b6b69b3408fd5539291d54db
|
|
| MD5 |
6085a804ccf338ab20006b4a1c2800f8
|
|
| BLAKE2b-256 |
bc5d4faa91cffc573b9aa878b9ff76de57c5e6cb7f4067a0d2f14bd71411f074
|
File details
Details for the file pyparcel-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyparcel-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec5c92db969ea85aaf1f6e31428aab922c0477a3d81e291cbdb6458a6134d30
|
|
| MD5 |
db41b97151f8c5c114d284ebf25dce7e
|
|
| BLAKE2b-256 |
a8d9071abc074082456fc21be2d3e29ab28f17865bc832992f832da707e2ec33
|