deepinsightapi package

Submodules

deepinsightapi.apinode_client module

class deepinsightapi.apinode_client.APINodeClient(uri, api_key)

Bases: deepinsightapi.base_client.DTBaseClient

auth()

Returns a handle to interact with authentication

deepinsightapi.base_client module

class deepinsightapi.base_client.DTBaseClient(base_uri, api_key=None, internal_ticket=None)

Bases: object

deepinsightapi.dtclient module

class deepinsightapi.dtclient.DTClient(host, api_key=None, internal_ticket=None)

Bases: object

Entry point for the DT API client

sql_query(connection=None, database=None, type='sql', extra_conf={})

Initiate a SQL, Hive or Impala query and get a handle to retrieve the results of the query. Internally, the query is run by DT. The database to run the query on is specified either by passing a connection name, or by passing a database name, or by passing a dataset full name (whose connection is then used to retrieve the database)

Parameters:
  • query (str) – the query to run
  • connection (str) – the connection on which the query should be run (exclusive of database and dataset_full_name)
  • database (str) – the database on which the query should be run (exclusive of connection and dataset_full_name)
  • dataset_full_name (str) – the dataset on the connection of which the query should be run (exclusive of connection and database)
  • type (str) – the type of query : either ‘sql’, ‘hive’ or ‘impala’
Returns:

A deepinsightapi.dt.sqlquery.DTSQLQuery query handle

deepinsightapi.utils module

class deepinsightapi.utils.DTStreamedHttpUTF8CSVReader(schema, csv_stream)

Bases: object

A CSV reader with a schema

iter_rows()
class deepinsightapi.utils.DTUTF8CSVReader(f, **kwds)

Bases: object

A CSV reader which will iterate over lines in the CSV file “f”, which is encoded in UTF-8.

next()
exception deepinsightapi.utils.DeepInsightException

Bases: Exception

Exception launched by the DeepInsight API clients when an error occurs

deepinsightapi.utils.none_if_throws(f)

Module contents