fusetools.dashboard_tools.Tableau

class fusetools.dashboard_tools.Tableau[source]

Bases: object

Functions for interacting with the Tableau Server API.

../_images/tableau1.png

Methods

auth_tableau_server

Authenticates a connection to a Tableau Server domain.

get_all_sever_items

Retrieves all projects on an organization’s Tableau server account.

get_tableau_server_obj_id

Returns the name and object id for a requested object name.

make_tableau_datasource_schema

Converts a Pandas DataFrame of column types & builds a Tableau schema list.

make_tableau_hyperfile

Creates a Tableau hyperfile (data source) to load to Tableau Server.

push_tableau_hyperfile

Pushes a Tableau hyperfile to Tableau Server to create a data source.

classmethod auth_tableau_server(server_address, username, pwd)[source]

Authenticates a connection to a Tableau Server domain.

Parameters
  • server_address – Tableau server domain address.

  • username – Tableau server username.

  • pwd – Tableau server password.

Returns

Tableau authentication object & Tableau server object.

classmethod get_all_sever_items(server, tableau_auth)[source]

Retrieves all projects on an organization’s Tableau server account.

Parameters
  • server – Tableau server object.

  • tableau_auth – Tableau authentication object.

Returns

Projects on an organization’s Tableau server account.

classmethod get_tableau_server_obj_id(server, tableau_auth, obj_name)[source]

Returns the name and object id for a requested object name.

Parameters
  • server – Tableau server domain address.

  • tableau_auth – Authenticated Tableau server object.

  • obj_name – Name to search for.

Returns

Name and object id for a requested object name.

classmethod make_tableau_datasource_schema(df_schema)[source]

Converts a Pandas DataFrame of column types & builds a Tableau schema list.

Parameters

df_schema – Pandas DataFrame of column types.

Returns

List of Tableau sqlType objects.

classmethod make_tableau_hyperfile(df, save_dir, hyperfile_name, tableau_schema_cols)[source]

Creates a Tableau hyperfile (data source) to load to Tableau Server.

Parameters
  • df – Pandas DataFrame to be loaded to Tableau server.

  • save_dir – Local filepath to save Pandas DataFrame as CSV.

  • hyperfile_name – Filename for hyperfile.

  • tableau_schema_cols – List of columns for the hyperfile with designated Tableau data types.

Returns

Tableau hyperfile.

classmethod push_tableau_hyperfile(hyperfile_path, server, tableau_auth, project_folder_id)[source]

Pushes a Tableau hyperfile to Tableau Server to create a data source.

Parameters
  • hyperfile_path – Path to Tableau hyperfile.

  • server – Tableau server object.

  • tableau_auth – Tableau authentication object.

  • project_folder_id – ID of Tableau server project folder.

Returns

Data source object for loaded hyperfile.