Skip to main content

WRAP msgpack encoding

Project description

polywrap-msgpack

Python implementation of the WRAP MsgPack encoding standard.

Usage

Encoding-Decoding Native types and objects

from polywrap_msgpack import msgpack_decode, msgpack_encode

dictionary = {
  "foo": 5,
  "bar": [True, False],
  "baz": {
    "prop": "value"
  }
}

encoded = msgpack_encode(dictionary)
decoded = msgpack_decode(encoded)

assert dictionary == decoded

Encoding-Decoding Extension types

from polywrap_msgpack import msgpack_decode, msgpack_encode, GenericMap

counter: GenericMap[str, int] = GenericMap({
  "a": 3,
  "b": 2,
  "c": 5
})

encoded = msgpack_encode(counter)
decoded = msgpack_decode(encoded)

assert counter == decoded

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

polywrap_msgpack-0.1.0a25.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

polywrap_msgpack-0.1.0a25-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

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