Visier¶
The Visier modules enable you to interact with either the Visier API, or to ingest a Visier Data Connector.
Usage¶
You can use this module in a few ways
Import the whole py4pa package:
import py4pa api = py4pa.VisierAPI(...) data_api = api.query_api(...) data_connector = py4pa.VisierDataConnector(...) data_dc = data_connector.get_connector(...)
Import the module directly:
from py4pa import VisierAPI, VisierDataConnector api = VisierAPI(...) data_api = api.query_api(...) data_connector = VisierDataConnector(...) data_dc = data_connector.get_connector(...)
Documentation¶
- class py4pa.VisierAPI(uname, pword, apikey, vanity_name, proxies=None, sslVerify=True)¶
Bases:
objectClass to help manage the authentication side of dealing with the Visier Data Query API endpoints
- Parameters:
uname (str) – The username of the API user
pword (str) – The password of the API user
apikey (str) – The company-wide API key accessed via the Visier Studio admin panel. Contact your admin if you are not sure.
vanity_name (str) –
The name associated with a Visier Cloud tenant. For example, a tenant for an organization called Jupiter would have the vanity name Jupiter. All tenants should use their own vanity name in the API URL. When making changes to an analytic tenant that you manage, the tenant is specified by its tenant code in the API call.
E.g. https://<<vanity_name>>.visier.com
- get_aggregation_query(query)¶
- get_list_query(query)¶
- get_properties_list(analyticObjectId)¶
- query_api(api_path, method='get', data=None, custom_headers=None)¶
Function to query Visier Data Query APIs
- Parameters:
api_path (Str) – The path of the url you wish to query. Must begin with ‘/’ e.g. ‘/data/model/analytic-objects/Employee/dimensions’
method (Str must be either 'get' or 'post') – The type of http request you are trying to make
data (Dictionary) – If your ‘method’ is ‘post’, this is the data you wish send as part of the request.
- class py4pa.VisierDataConnector(company, api_key, user, pword, proxies=None, sslVerify=True)¶
Bases:
objectClass to manage ingestion of Visier data connectors
See Visier user documentation for more information (you will need to log in to the service portal first): https://my.visier.com/csm?id=kb_article_view&sysparm_article=KB0014851
- Parameters:
company (str) – The company name used to connect to the Visier application e.g. [company].visier.com
api_key (str) – The API key generated in the admin panel of the Visier application
user (str) – The username used to connect to the data_connectors (typically email). This user must have access to all data connectors that you intend to connect to with this Class
pword (str) – The associated password for
userproxies (dict) – Dictionary containing ‘http_proxy’ and ‘https_proxy’ keys
sslVerify (bool) – Defaults to True. If set to False, bypasses HTTPS Certificate verification (very dangerous)
- get_connector(connector_id, fName=None)¶
Function to make API call to Visier Data Connectors
- Parameters:
connector_id (String) – String of id of data connector, available from Visier
fName (String, optional) – Full file path, including csv extension that you want to give your file if you want to save it. If not declared, no file will be saved.
- Returns:
df – Pandas Dataframe of returned data from the connector
- Return type:
Pandas Dataframe