icat.dumpfile_yaml
— YAML data file backend¶
This module provides the YAML backend for icat.dumpfile
. See
the documentation of that module on how to read and write ICAT data
files.
-
class
icat.dumpfile_yaml.
YAMLDumpFileReader
(client, infile)¶ Bases:
icat.dumpfile.DumpFileReader
Backend for reading ICAT data from a YAML file.
-
mode
= 'rt'¶ File mode suitable for this backend.
-
getdata
()¶ Iterate over the chunks in the data file.
-
getobjs_from_data
(data, objindex)¶ Iterate over the objects in a data chunk.
Yield a new entity object in each iteration. The object is initialized from the data, but not yet created at the client.
-
-
class
icat.dumpfile_yaml.
YAMLDumpFileWriter
(client, outfile)¶ Bases:
icat.dumpfile.DumpFileWriter
Backend for writing ICAT data to a YAML file.
-
mode
= 'wt'¶ File mode suitable for this backend.
-
head
()¶ Write a header with some meta information to the data file.
-
startdata
()¶ Start a new data chunk.
If the current chunk contains any data, write it to the data file.
-
writeobj
(key, obj, keyindex)¶ Add an entity object to the current data chunk.
-
finalize
()¶ Finalize the data file.
-