You're reading an old version of this documentation. For up-to-date information, please have a look at v0.7.
aspecd.infofile module¶
Handle infofile files containing meta data for (experimental) data.
The infofile format is a special format dedicated to storing meta data accompanying experimental data. Further information can be found online:
https://www.till-biskup.de/en/software/info/format
This module reads and parses files complying with the infofile file format.
Note
For own purposes, you may prefer using YAML files to store metadata that are collected in parallel to recording data over the infofile format. For more information on this format and it specification, consult its webpage: http://yaml.org/.
As the lead developer of the ASpecD framework originally invented the infofile format for own purposes, there are quite some datasets floating around in his lab using this format for the corresponding metadata. Hence the need of a module handling this particular file type.
To map the information contained in the info file to datasets, have a look
at the aspecd.metadata.MetadataMapper
class. You can define rather
elaborate mapping tables, allowing to rename keys as well as to combine
items of a dictionary.
-
class
aspecd.infofile.
Infofile
(filename=None)¶ Bases:
object
Reading metadata contained in info files.
-
parameters
¶ Structure containing parameters read from info file.
-
infofile_info
¶ Information about the infofile, such as kind, version, and date.
Helpful for mapping metadata contained in an infofile to datasets.
- Type
- Parameters
filename (
str
) – Name of the info file to read- Raises
aspecd.exceptions.InfofileEmptyError – Raised if info file is empty
aspecd.exceptions.InfofileTypeError – Raised if file provided is no info file
Changed in version 0.6.3: Comment gets converted into a single string.
-
parse
()¶ Parse info file.
- Raises
aspecd.exceptions.InfofileEmptyError – Raised if info file is empty
aspecd.exceptions.InfofileTypeError – Raised if file provided is no info file
-
-
aspecd.infofile.
parse
(filename='')¶ Parse info file.
Conventional interface provided for convenience that gives easy access to the metadata stored in an infofile. For full use of the capabilities of the
Infofile
class, use its object-oriented interface.Warning
This will only return the metadata read from the info file, not the version information that is read and parsed as well. To obtain this version information, e.g., for mapping of metadata onto other structures, you should use the object-oriented interface of the
Infofile
class.