Skip to main content

Simple and fast Python any object serialization with use msgpack.

Project description

Introduction

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


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


# create coder
coder = UmsgpackCoder()

# register your classes (required because of security reasons)
coder.set_default_coder_for_class(self.YourClass)
coder.set_default_coder_for_class(self.YourNestedClass)

# 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.

Source Distribution

cw_msgpack_coder-1.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cw_msgpack_coder-1.1.3-py3.6.egg (5.6 kB view details)

Uploaded Egg

File details

Details for the file cw_msgpack_coder-1.1.3.tar.gz.

File metadata

File hashes

Hashes for cw_msgpack_coder-1.1.3.tar.gz
Algorithm Hash digest
SHA256 9a467fdefb5390ace8929d555f75d026c45de7b7c9d1fe51e2bf0579fd48c188
MD5 958df6567efba316b148caac5929001e
BLAKE2b-256 c052a0f15fdaff70c22de4a84936fcf1ecd0fee2781f6411464cca82908ae15d

See more details on using hashes here.

File details

Details for the file cw_msgpack_coder-1.1.3-py3.6.egg.

File metadata

  • Download URL: cw_msgpack_coder-1.1.3-py3.6.egg
  • Upload date:
  • Size: 5.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for cw_msgpack_coder-1.1.3-py3.6.egg
Algorithm Hash digest
SHA256 38ec0dd5b94ac6f90684fb161a27b3d50efa600a144ec81e479eafc462c69504
MD5 5e418dbd92d0bf46df6b276538a499a4
BLAKE2b-256 f83294467b5be9fbe9e4b9da3592c2fef91e1434caafad39c9cc19a09875a4b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page