Find Variable#
Note
The terminology of variable might be reworked, as a variable is not taken in a strict sense of physical parameters, but also compound datasets. This might be reworked in a future version.
An Entry is defined to be the atomic entitiy in metacatalog, by describing the metadata of one dataset of unique Variable. Each variable has one unit. If another dataset of same variable is uploaded, but uses a different unit, it has to be converted to avoid misinterpretations.
Variable#
- metacatalog.api.find_variable(return_iterator: typing_extensions.Literal[False] = False) List['Variable'] #
- metacatalog.api.find_variable(return_iterator: typing_extensions.Literal[True] = False) Query
Return one vriable entry from the database on exact matches. It makes only sense to set one of the attributes (id, name, symbol).
Changed in version 0.1.8: string matches now allow ‘%’ and ‘*’ wildcards and can be inverted by prepending !
- Parameters:
session (sqlalchemy.Session) – SQLAlchemy session connected to the database.
id (integer) – Database unique ID of the requested record. Will return only one record.
name (str) – name attribute of the requested variable.
symbol (str) – symbol attribute of the requested variable.
return_iterator (bool) – If True, an iterator returning the requested objects instead of the objects themselves is returned.
- Returns:
records – List of matched Variable instance.
- Return type:
list of metacatalog.Variable
Unit#
- metacatalog.api.find_unit(return_iterator: typing_extensions.Literal[False] = False) List['Unit'] #
- metacatalog.api.find_unit(return_iterator: typing_extensions.Literal[True] = False) Query
Return one unit entry from the database on exact matches. It makes only sense to set one of the attributes (id, name, symbol).
Changed in version 0.1.8: string matches now allow ‘%’ and ‘*’ wildcards and can be inverted by prepending !
- Parameters:
session (sqlalchemy.Session) – SQLAlchemy session connected to the database.
id (integer) – Database unique ID of the requested record. Will return only one record.
name (str) – name attribute of the requested unit.
symbol (str) – symbol attribute of the requested unit.
return_iterator (bool) – If True, an iterator returning the requested objects instead of the objects themselves is returned.
- Returns:
records – List of matched Unit instance.
- Return type:
list of metacatalog.Unit