SDF.file_io: Read and write files

The submodule SDF.file_io contains the functionality for reading files to SDF objects and writing those to files.

Read

To read files to SDF objects, there are multiple functions, one per implemented input format:

They all expect a filename as argument and return an SDF Object (usually a Workspace).

Write

SDF Objects (Workspace and Dataset types) can be written to files by calling write_sdf (sdf_object, filename).

This calls XMLWritable.to_xml_element () and serializes that XML Element to a text file. This could also be done by any other XML library.

Example

from SDF.file_io import load_from_lsm, write_sdf

sdf = load_from_lsm("my-data.lsm")
write_sdf(sdf, "my-data.sdf")