vantage6.algorithm.tools.wrappers.load_data#

load_data(database_uri, db_type=None, query=None, sheet_name=None)#

Read data from database and give it back to the algorithm.

If the database type is unknown, this function will exit. Also, a ‘query’ is required for SQL and SparQL databases. If it is not present, this function will exit the algorithm.

Parameters:
  • database_uri (str) – Path to the database file or URI of the database.

  • db_type (str) – The type of the database. This should be one of the CSV, SQL, Excel, Sparql or Parquet.

  • query (str) – The query to execute on the database. This is required for SQL and Sparql databases.

  • sheet_name (str) – The sheet name to read from the Excel file. This is optional and only for Excel databases.

Returns:

The data from the database

Return type:

pd.DataFrame