spinetoolbox.project_items.exporter.db_utils

Contains utility functions to help with Spine databases.

author:
  1. Soininen (VTT)
date:

5.9.2019

Module Contents

Functions

latest_database_commit_time_stamp(database_map) Searches the latest commit timestamp from given database
scenario_filtered_database_map(database_url, scenario) Creates a database mapping and applies scenario filtering to it.
spinetoolbox.project_items.exporter.db_utils.latest_database_commit_time_stamp(database_map)[source]

Searches the latest commit timestamp from given database

Parameters:database_map (DatabaseMappingBase) – database map
Returns:latest time stamp or None if there are no commits.
Return type:datetime
spinetoolbox.project_items.exporter.db_utils.scenario_filtered_database_map(database_url, scenario)[source]

Creates a database mapping and applies scenario filtering to it.

Parameters:
  • database_url (str) – database URL
  • scenario (str, optional) – scenario name or None for the ‘Base’ alternative
Returns:

database mapping

Return type:

DatabaseMapping