Skip to main content

Simple and fast Python any object serialization with use msgpack.

Project description


Simple pure Python object encoder and decoder using msgpack (u-msgpack-python package at bottom).

It allows encode Python object with high speed and compression since we using msgpack at bottom.

It reduce code overhead to minimum and allow you focus on algorithms.

How to use it

It is very simple:

from cw_msgpack_coder.umsgpack_coder import UmsgpackCoder

class YourNestedClass:

class YourClass:
    def __init__(name, nested) = name
        self.nested = nested

# create coder
coder = UmsgpackCoder()

# register your classes
# required because of security reasons

# register old modules and classes names
# required if you renamed some modules or classes and want load old data
# not need for this example
    'old_module_name', 'YourClass',
    '__main__', 'YourClass')

# now create some objects to test
o = YourClass('hello world!', YourNestedClass())

# encode to bytes
encoded = coder.dumps(o)

# decode bytes to objects
o2 = coder.decode(encoded)

# o == o2!

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 cw_msgpack_coder, version 1.1.8
Filename, size File type Python version Upload date Hashes
Filename, size cw_msgpack_coder-1.1.8.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

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