Skip to content

najaco/pyparcel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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:

  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

About

The simple and secure way to convert objects to bytestrings.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages