Connector

In all the specific connectors, the parameters for the new() method are the same as the ones in the Connector._new().

class previsionio.connector.Connector(_id: str, project_id: str, name: str)

Bases: previsionio.api_resource.ApiResource, previsionio.api_resource.UniqueResourceMixin

A connector to interact with a distant source of data (and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
delete()

Delete a connector from the actual [client] workspace.

Raises:
  • PrevisionException – If the connector does not exist
  • requests.exceptions.ConnectionError – Error processing the request
classmethod list(project_id: str, all: bool = False)

List all the available connectors in the current active [client] workspace.

Warning

Contrary to the parent list() function, this method returns actual Connector objects rather than plain dictionaries with the corresponding data.

Parameters:
  • project_id (str) – Unique reference of the project id on the platform
  • all (boolean, optional) – Whether to force the SDK to load all items of the given type (by calling the paginated API several times). Else, the query will only return the first page of result.
Returns:

Fetched connector objects

Return type:

list(Connector)

test()

Test a connector already uploaded on the platform.

Returns:Test results
Return type:dict
class previsionio.connector.DataFileBaseConnector(_id: str, project_id: str, name: str, host: str, port: int, username: str)

Bases: previsionio.connector.Connector

A specific type of connector to interact with a database client (containing files), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source
list_files()

List all available tables in a specific database for the client.

Parameters:database (str) – Name of the database to find tables for
Returns:files information
Return type:dict
class previsionio.connector.DataTableBaseConnector(_id: str, project_id: str, name: str, host: str, port: int, username: str)

Bases: previsionio.connector.Connector

A specific type of connector to interact with a database client (containing databases and tables), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source
list_databases()

List all available databases for the client.

Returns:Databases information
Return type:dict
list_tables(database: str)

List all available tables in a specific database for the client.

Parameters:database (str) – Name of the database to find tables for
Returns:Tables information
Return type:dict
class previsionio.connector.FTPConnector(_id: str, project_id: str, name: str, host: str, port: int, username: str)

Bases: previsionio.connector.DataFileBaseConnector

A specific type of connector to interact with a FTP client (containing files), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source
class previsionio.connector.GCPConnector(_id: str, project_id: str, name: str)

Bases: previsionio.connector.Connector

A specific type of connector to interact with a GCP database client (containing databases and tables or buckets), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
class previsionio.connector.GCloud

Bases: enum.Enum

Google services.

big_query = 'BigQuery'

Google BigQuery

storage = 'Storage'

Google Storage

class previsionio.connector.S3Connector(_id: str, project_id: str, name: str, username: str)

Bases: previsionio.connector.Connector

A specific type of connector to interact with an Amazon S3 client (containing buckets with files), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source
class previsionio.connector.SFTPConnector(_id: str, project_id: str, name: str, host: str, port: int, username: str)

Bases: previsionio.connector.DataFileBaseConnector

A specific type of connector to interact with a secured FTP client (containing files), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source
class previsionio.connector.SQLConnector(_id: str, project_id: str, name: str, host: str, port: int, username: str)

Bases: previsionio.connector.DataTableBaseConnector

A specific type of connector to interact with a SQL database client (containing databases and tables), and easily get data snapshots using an associated DataSource resource).

Parameters:
  • _id (str) – Unique reference of the connector on the platform
  • project_id (str) – Unique reference of the project id on the platform
  • name (str) – Name of the connector
  • host (str) – Url of the connector
  • port (int) – Port of the connector
  • username (str) – Username to use connect to the remote data source