Module AnalyticsClient :: Class AnalyticsClient
[hide private]
[frames] | no frames]

Class AnalyticsClient

source code

AnalyticsClient provides the python based language binding to the https based API of Zoho Analytics.

Nested Classes [hide private]
  OrgAPI
OrgAPI contains organization level operations.
  WorkspaceAPI
WorkspaceAPI contains workspace level operations.
  ViewAPI
ViewAPI contains view level operations.
  BulkAPI
BulkAPI contains data operations.
Instance Methods [hide private]
 
__init__(self, client_id, client_secret, refresh_token)
Creates a new AnalyticsClient instance.
source code
 
get_org_instance(self, org_id)
Returns a new OrgAPI instance.
source code
 
get_workspace_instance(self, org_id, workspace_id)
Returns a new WorkspaceAPI instance.
source code
 
get_view_instance(self, org_id, workspace_id, view_id)
Returns a new ViewAPI instance.
source code
 
get_bulk_instance(self, org_id, workspace_id)
Returns a new BulkAPI instance.
source code
list
get_orgs(self)
Returns list of all accessible organizations.
source code
list
get_workspaces(self)
Returns list of all accessible workspaces.
source code
list
get_owned_workspaces(self)
Returns list of owned workspaces.
source code
list
get_shared_workspaces(self)
Returns list of shared workspaces.
source code
list
get_recent_views(self)
Returns list of recently accessed views.
source code
list
get_dashboards(self)
Returns list of all accessible dashboards.
source code
list
get_owned_dashboards(self)
Returns list of owned dashboards.
source code
list
get_shared_dashboards(self)
Returns list of shared dashboards.
source code
dictionary
get_workspace_details(self, workspace_id)
Returns details of the specified workspace.
source code
dictionary
get_view_details(self, view_id, config={})
Returns details of the specified view.
source code
 
set_proxy(self, proxy_host, proxy_port, proxy_user_name, proxy_password)
Internal method to handle proxy details.
source code
 
send_batch_import_api_request(self, request_url, config, request_headers, file_path, batch_size, tool_config) source code
 
send_import_api_request(self, request_url, config, request_headers, file_path, data=None)
Internal method to handle HTTP request.
source code
 
submit_import_request(self, request_url, parameters, request_headers={}, access_token=None, files=None)
Internal method to send request to server.
source code
 
send_export_api_request(self, request_url, config, request_headers, file_path)
Internal method to handle HTTP request.
source code
 
submit_export_request(self, request_url, parameters, request_headers={}, access_token=None)
Internal method to send request to server.
source code
 
send_api_request(self, request_method, request_url, config, request_headers, is_json_response=True)
Internal method to handle HTTP request.
source code
 
submit_request(self, request_method, request_url, parameters, request_headers={}, access_token=None)
Internal method to send request to server.
source code
 
get_request_obj(self)
Internal method for getting OAuth token.
source code
 
is_oauth_expired(self, resp_obj)
Internal method to check whether the accesstoken expired or not.
source code
 
regenerate_analytics_oauth_token(self)
Internal method for getting OAuth token.
source code
Class Variables [hide private]
  CLIENT_VERSION = '2.4.0'
  COMMON_ENCODE_CHAR = 'UTF-8'
Method Details [hide private]

__init__(self, client_id, client_secret, refresh_token)
(Constructor)

source code 

Creates a new AnalyticsClient instance.

Parameters:
  • client_id (string) - User client id for OAUth
  • client_secret (string) - User client secret for OAuth
  • refresh_token (string) - User's refresh token for OAUth).

get_org_instance(self, org_id)

source code 

Returns a new OrgAPI instance.

Parameters:
  • org_id (string) - The id of the organization.

get_workspace_instance(self, org_id, workspace_id)

source code 

Returns a new WorkspaceAPI instance.

Parameters:
  • org_id (string) - The id of the organization.
  • workspace_id (string) - The id of the workspace.

get_view_instance(self, org_id, workspace_id, view_id)

source code 

Returns a new ViewAPI instance.

Parameters:
  • org_id (string) - The id of the organization.
  • workspace_id (string) - The id of the workspace.
  • view_id (string) - The id of the view.

get_bulk_instance(self, org_id, workspace_id)

source code 

Returns a new BulkAPI instance.

Parameters:
  • org_id (string) - The id of the organization.
  • workspace_id (string) - The id of the workspace.

get_orgs(self)

source code 

Returns list of all accessible organizations.

Returns: list
Organization list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_workspaces(self)

source code 

Returns list of all accessible workspaces.

Returns: list
Workspace list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_owned_workspaces(self)

source code 

Returns list of owned workspaces.

Returns: list
Workspace list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_shared_workspaces(self)

source code 

Returns list of shared workspaces.

Returns: list
Workspace list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_recent_views(self)

source code 

Returns list of recently accessed views.

Returns: list
View list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_dashboards(self)

source code 

Returns list of all accessible dashboards.

Returns: list
Dashboard list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_owned_dashboards(self)

source code 

Returns list of owned dashboards.

Returns: list
Dashboard list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_shared_dashboards(self)

source code 

Returns list of shared dashboards.

Returns: list
Dashboard list.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_workspace_details(self, workspace_id)

source code 

Returns details of the specified workspace.

Parameters:
  • workspace_id (string) - Id of the workspace.
Returns: dictionary
Workspace details.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.

get_view_details(self, view_id, config={})

source code 

Returns details of the specified view.

Parameters:
  • view_id (string) - Id of the view.
  • config (dictionary) - Contains any additional control parameters. Can be None.
Returns: dictionary
View details.
Raises:
  • ServerError - If the server has received the request but did not process the request due to some error.
  • ParseError - If the server has responded but client was not able to parse the response.