deriva.utils.catalog.manage package¶
Submodules¶
deriva.utils.catalog.manage.config module¶
deriva.utils.catalog.manage.deriva_csv module¶
deriva.utils.catalog.manage.dump_catalog module¶
-
class
deriva.utils.catalog.manage.dump_catalog.
DerivaCatalogToString
(catalog, provide_system_columns=True, groups=None)[source]¶ Bases:
object
-
annotations_to_str
(annotations, var_name='annotations')[source]¶ Print out the annotation definition in annotations, substituting the python variable for each of the tags specified in tag_map. :param annotations: :param var_name: :return:
-
substitute_variables
(code)[source]¶ Factor out code and replace with a variable name. :param code: :return: new code
-
tag_variables_to_str
(annotations)[source]¶ For each convenient annotation name in tag_map, print out a variable declaration of the form annotation = v where v is the value of the annotation the dictionary. If the tag is not in the set of annotations, do nothing. :param annotations: :return:
-
variable_to_str
(name, value, substitute=True)[source]¶ Print out a variable assignment on one line if empty, otherwise pretty print. :param name: Left hand side of assigment :param value: Right hand side of assignment :param substitute: If true, replace the group and tag values with their corresponding names :return:
-
-
class
deriva.utils.catalog.manage.dump_catalog.
DerivaDumpCatalogCLI
(description, epilog)[source]¶ Bases:
deriva.core.base_cli.BaseCLI
-
exception
deriva.utils.catalog.manage.dump_catalog.
DerivaDumpCatalogException
(message)[source]¶ Bases:
Exception
Base exception class for DerivaDumpCatalog.
-
exception
deriva.utils.catalog.manage.dump_catalog.
UsageException
(message)[source]¶ Bases:
deriva.utils.catalog.manage.dump_catalog.DerivaDumpCatalogException
Usage exception.
deriva.utils.catalog.manage.graph_catalog module¶
-
class
deriva.utils.catalog.manage.graph_catalog.
DerivaCatalogToGraph
(catalog, engine='dot')[source]¶ Bases:
object
-
catalog_to_graph
(schemas=None, skip_terms=False, skip_association_tables=False)[source]¶ Convert a catalog to a DOT based graph. :param schemas: List of schemas that should be included. Use whole catalog if None. :param skip_terms: Do not include term tables in the graph :param skip_association_tables: Collapse association tables so that only edges between endpoints are used :return:
-
foreign_key_defs_to_graph
(table, skip_terms=False, skip_association_tables=False, schemas=[])[source]¶ Add edges for each foreign key relationship in the specified table. :param table: :param skip_terms: :param skip_association_tables: :param skip_schemas: :return:
-
schema_to_graph
(schema_name, schemas=[], skip_terms=False, skip_association_tables=False)[source]¶ Create a graph for the specified schema. :param schema_name: Name of the schema in the model to be used. :param schemas: List of additional schemas to include in the graph. :param skip_terms: :param skip_association_tables: :return:
-
deriva.utils.catalog.manage.update_catalog module¶
deriva.utils.catalog.manage.utils module¶
-
class
deriva.utils.catalog.manage.utils.
LoopbackCatalog
(model=None)[source]¶ Bases:
object
-
class
LoopbackResult
(uri, json=None)[source]¶ Bases:
object
Class to simulate interactions with a catalog host.
-
catalog_id
¶
-
class
-
class
deriva.utils.catalog.manage.utils.
LoopbackModel
(arg)[source]¶ Bases:
deriva.core.ermrest_model.Model
-
apply
(_)[source]¶ Apply catalog configuration to catalog unless existing already matches.
Parameters: existing – An instance comparable to self. The configuration in self will be applied recursively to the corresponding model nodes in schema.
If existing is not provided (default), the current whole configuration will be retrieved from the catalog and used automatically to determine whether the configuration goals under this Model tree are already met or need to be remotely applied.
-
-
class
deriva.utils.catalog.manage.utils.
TempErmrestCatalog
(scheme, server, **kwargs)[source]¶ Bases:
deriva.core.ermrest_catalog.ErmrestCatalog
Create a new catalog. Can be used as as context so that catalog is automatically deleted.