Skip to main content

Packet serialization/deserialization in a Pythonic way.

Project description


Network protocol library. Handles packet serialization/deserialization in a Pythonic way.


  • Define a basic protocol :
import packel

class Ping(packel.Packet):
    text = packel.String()

class Pong(packel.Packet):
    is_hello = packel.Boolean()

protocol = packel.Protocol([Ping, Pong])
  • Use it to serialize and deserialize data :
request = Ping(text='hello')
serialized_bytes = protocol.serialize(request)

# ...

packet = protocol.deserialize(serialized_bytes)
if isinstance(packet, Ping):
    is_hello = packet.text == 'hello'
    response = Pong(is_hello=is_hello)
    # ...

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for packel, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size packel-1.0.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View
Filename, size packel-1.0.0-py3-none-any.whl (3.7 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page