hydrodata.data_catalog.data_model_access module
Functions to load the csv files of the data catalog model into a DataModel object.
Contains one function load_data_model() to load the model and several classes to represent the loaded model.
This can be used to load the data catalog model and access all the tables and rows and columns of the model.
Also see the data_access.py module for methods to access information from /hydrodata using the model.
- Usage:
data_model = hydrodata.data_catalog.load_data_model()
print(data_model.table_names)
- class hydrodata.data_catalog.data_model_access.DataModel
Bases:
object
Represents a data catalog model.
- get_table(table_name: str) ModelTable
Get the ModelTable object with the table_name.
- table_names
A list of table names of the model.
- class hydrodata.data_catalog.data_model_access.ModelTable
Bases:
object
Represents a model table.
- column_names
A list of the column names in the table.
- get_row(row_id: str) ModelTableRow
Get the ModelTableRow of a row ID.
- row_ids
A list of row IDs in the table.
- class hydrodata.data_catalog.data_model_access.ModelTableRow
Bases:
object
Represents one row in a model table.
- column_names()
Return the column names of the row.
- get_value(column_name: str) str
Get the value of the named column in the row.
- set_value(column_name: str, value)
Set the value of the named column in the row.