Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 731 Bytes

xml_codec.rst

File metadata and controls

40 lines (23 loc) · 731 Bytes

XML Codec

Codec for serialising and de-serialising XML data. Supports both array and objects for mapping into resources or collections of resources.

odin.codecs.xml_codec

Methods

dump

dumps

Unsupported Fields

There is no direct representation for a :pyodin.fields.DictField.

Example usage

Loading a resource from a file:

from odin.codecs import xml_codec

with open('my_resource.xml') as f:
    resource = xml_codec.load(f)

Saving a resource to a file:

from odin.codecs import xml_codec

with open('my_resource.xml', 'w') as f:
    xml_codec.dump(f, resource)