omero.util.metadata_utils module¶
Utilities for manipulating bulk-annotations
Includes classes to help with basic data-munging (TODO), and for formatting data for clients.
- class util.metadata_utils.BulkAnnotationConfiguration(default_cfg, column_cfgs)[source]¶
Bases:
object
Parent class for handling bulk-annotation column configurations
- GROUPREQUIRED = {'columns', 'namespace'}¶
- OPTIONAL = {'clientname', 'clientvalue', 'include', 'includeclient', 'omitempty', 'position', 'split', 'type', 'visible'}¶
- REQUIRED = {'name'}¶
- get_column_config(cfg)[source]¶
Replace unspecified fields in a column config with defaults If this is a group return a GroupConfig object
- static get_default_cfg(cfg)[source]¶
Get the default column configuration, fill in unspecified fields
- classmethod validate_column_config(cfg)[source]¶
Check whether a column config section is valid, throws Exception if not
- class util.metadata_utils.KeyValueGroupList(headers, default_cfg, column_cfgs)[source]¶
Bases:
BulkAnnotationConfiguration
Converts bulk-annotation rows into key-value lists
- get_group_output_configs(column_cfgs, isdefault)[source]¶
Get the full set of output column configs for a single group, taking into account specified column positions and columns included/excluded according to the defaults:
positioned columns are at the specified index (1-based)
gaps between positioned columns are filled with unpositioned columns in order of - Configured but unpositioned columns - Unconfigured columns in order of headers (assuming the default config is for them to be included)
If there are gaps and no remaining columns to be included raise an exception
- class util.metadata_utils.KeyValueListPassThrough(headers, default_cfg=None, column_cfgs=None)[source]¶
Bases:
object
Converts bulk-annotation rows into key-value lists without any transformation
- class util.metadata_utils.KeyValueListTransformer(headers, output_configs, name=None)[source]¶
Bases:
object
Converts bulk-annotation rows into key-value lists