MessagePack for Python

1.1.2 · active · verified Sat Mar 28

MessagePack is a fast and compact binary serialization format. The Python implementation, msgpack-python, is actively maintained with the latest release being version 1.1.2. It supports Python versions 3.9 and above, with a release cadence of approximately every few months.

Warnings

Install

Imports

Quickstart

A simple example demonstrating how to serialize and deserialize data using msgpack.

import msgpack

# Data to be serialized
data = {'key': 'value', 'number': 42}

# Serialize data
packed = msgpack.packb(data)

# Deserialize data
unpacked = msgpack.unpackb(packed)

print(unpacked)

view raw JSON →