import msgpack # create an empty MsgPack object msg = msgpack.MsgPack() # set parameters for the MsgPack object msg.setParam('compact', True) msg.setParam('raw', True) # encode some data data = {'name': 'Alice', 'age': 25} packed_data = msg.packb(data) # decode the data unpacked_data = msg.unpackb(packed_data) print(unpacked_data)
pip install msgpack