Codec for serialising and de-serialising TOML data. Supports both array and objects for mapping into resources or collections of resources.
The TOML codec uses the :pytoml
module.
odin.codecs.toml_codec
load
loads
dump
dumps
Serialisation of Odin resources is handled by a customised :pytoml.Encoder
. Additional data types can be appended to the :pyodin.codecs.toml_codec.TOML_TYPES
dictionary.
Loading a resource from a file:
from odin.codecs import toml_codec
with open('my_resource.toml') as f:
resource = toml_codec.load(f)