spinetoolbox.spine_io.importers.json_reader

Contains JSONConnector class.

author:
  1. Marin (KTH)
date:

10.2.2020

Module Contents

Classes

JSONConnector Template class to read data from another QThread.

Functions

select_json_file(parent=None) Launches QFileDialog with .json filter
_tabulize_json(obj)
_tabulize_json_object(obj)
_tabulize_json_array(arr)
spinetoolbox.spine_io.importers.json_reader.select_json_file(parent=None)[source]

Launches QFileDialog with .json filter

class spinetoolbox.spine_io.importers.json_reader.JSONConnector(settings)[source]

Bases: spinetoolbox.spine_io.io_api.SourceConnection

Template class to read data from another QThread.

Parameters:settings (dict, optional) – connector specific settings or None
DISPLAY_NAME = JSON[source]
OPTIONS[source]
SELECT_SOURCE_UI[source]
connect_to_source(self, source)[source]

saves filepath

Parameters:{str} -- filepath (source) –
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]
file_iterator(self, table, options, max_rows=-1)[source]
get_data_iterator(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.

spinetoolbox.spine_io.importers.json_reader._tabulize_json(obj)[source]
spinetoolbox.spine_io.importers.json_reader._tabulize_json_object(obj)[source]
spinetoolbox.spine_io.importers.json_reader._tabulize_json_array(arr)[source]