spine_io.io_api

Contains a class template for a data source connector used in import ui.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

class spine_io.io_api.SourceConnection[source]

Template class to read data from another QThread

DISPLAY_NAME = unnamed source[source]
OPTIONS[source]
SELECT_SOURCE_UI[source]
connect_to_source(self, source)[source]

Connects to source, ex: connecting to a database where source is a connection string.

Parameters:{} -- object with information on source to be connected to, ex (source) – filepath string for a csv connection
disconnect(self)[source]

Disconnect from connected source.

get_tables(self)[source]

Method that should return a list of table names, list(str)

Raises:NotImplementedError – [description]
get_data_iterator(self, table, options, max_rows=-1)[source]

Function that should return a data iterator, data header and number of columns.

get_data(self, table, options, max_rows=-1)[source]

Return data read from data source table in table. If max_rows is specified only that number of rows.

get_mapped_data(self, tables_mappings, options, max_rows=-1)[source]

Reads all mappings in dict tables_mappings, where key is name of table and value is the mappings for that table. emits mapped data when ready.