spinedb_api.filters.renamer
Provides a database query manipulator that renames database items.
Module Contents
Functions
|
Applies renaming to entity class subquery. |
|
Creates a config dict for renamer. |
|
Applies entity class renamer manipulator to given database map. |
Makes a shorthand string from renamer configuration. |
|
|
Makes configuration dictionary out of a shorthand string. |
|
Applies renaming to parameter definition subquery. |
|
Creates a config dict for renamer. |
|
Applies parameter renamer manipulator to given database map. |
Makes a shorthand string from renamer configuration. |
|
|
Makes configuration dictionary out of a shorthand string. |
- spinedb_api.filters.renamer.apply_renaming_to_entity_class_sq(db_map, name_map)[source]
Applies renaming to entity class subquery.
- Parameters:
db_map (DatabaseMapping) – a database map
name_map (dict) – a map from old name to new name
- spinedb_api.filters.renamer.entity_class_renamer_config(**renames)[source]
Creates a config dict for renamer.
- Parameters:
**renames – keyword is the old name, value is the new name
- Returns:
renamer configuration
- Return type:
- spinedb_api.filters.renamer.entity_class_renamer_from_dict(db_map, config)[source]
Applies entity class renamer manipulator to given database map.
- Parameters:
db_map (DatabaseMapping) – target database map
config (dict) – renamer configuration
- spinedb_api.filters.renamer.entity_class_renamer_config_to_shorthand(config)[source]
Makes a shorthand string from renamer configuration.
- spinedb_api.filters.renamer.entity_class_renamer_shorthand_to_config(shorthand)[source]
Makes configuration dictionary out of a shorthand string.
- spinedb_api.filters.renamer.apply_renaming_to_parameter_definition_sq(db_map, name_map)[source]
Applies renaming to parameter definition subquery.
- Parameters:
db_map (DatabaseMapping) – a database map
name_map (dict) – a map from old name to new name
- spinedb_api.filters.renamer.parameter_renamer_config(renames)[source]
Creates a config dict for renamer.
- spinedb_api.filters.renamer.parameter_renamer_from_dict(db_map, config)[source]
Applies parameter renamer manipulator to given database map.
- Parameters:
db_map (DatabaseMapping) – target database map
config (dict) – renamer configuration