Codec for serialising and de-serialising data in MessagePack format. Supports both array and objects for mapping into resources or collections of resources.
The MessagePack codec uses the :pymsgpack-python
module.
odin.codecs.msgpack_codec
load
loads
dump
dumps
Serialisation of Odin resources is handled by a customised :pymsgpack.Packer
. Additional data types can be appended to the :pyodin.codecs.msgpack_codec.TYPE_SERIALIZERS
dictionary.
Loading a resource from a file:
from odin.codecs import msgpack_codec
with open('my_resource.msgp') as f:
resource = msgpack_codec.load(f)