Current Release: 0.3.0
pip3 install pydomo
, and can be updated via pip3 install pydomo --upgrade
pip3 install pydomo
pip3 install pydomo --upgrade
Below are examples of how to use the SDK to perform a few common tasks. To run similar code on your system, do the following.
from pydomo import Domo
domo = Domo('client-id','secret',api_host='api.domo.com')
car_data = domo.ds_get('2f09a073-54a4-4269-8c62-b776e67d59f0')
car_summary = car_data.groupby(['make','model']).agg({'dollars':'mean'}).reset_index()
car_ds = domo.ds_create(car_summary,'Python | Car Summary Data Set','Python | Generated during demo')
car_summary2 = car_data.groupby(['make','model'],as_index=False).agg({'dollars':'mean','email':'count'}).reset_index() car_update = domo.ds_update(car_ds,car_summary2)
from pydomo.datasets import Policy, PolicyFilter, FilterOperator, PolicyType, Sorting
pdp_filter = PolicyFilter() pdp_filter.column = 'make' # The DataSet column to filter on pdp_filter.operator = FilterOperator.EQUALS pdp_filter.values = ['Honda'] # The DataSet row value to filter on
pdp_request = Policy() pdp_request.name = 'Python | US East' pdp_request.filters = [pdp_filter] pdp_request.type = PolicyType.USER pdp_request.users = [] pdp_request.groups = [1631291223]
domo.pdp_create(car_ds,pdp_request)
all_groups = domo.groups_list() # List all groups all_users = domo.users_list() # List all users
domo.groups_list_users(328554991)
added_users = domo.groups_add_users(328554991,2063934980) domo.groups_list_users(328554991)
### Available Functions
The functions in this package match most parts of the API documented at [developer.domo.com](https://developer.domo.com/) and follow a specific convention. Each set of functions is preceeded by the portion of the API it operates on. The following lists all the sets of functions available in this package. For further help, refer to the help function in Python.
* **Data sets** - This set of functions is designed to transfer data in and out of Domo.
* **ds_get** - downloads data from Domo
* **ds_create** - creates a new data set
* **ds_update** - updates an existing data set, only data sets created by the API can be updated
* **ds_meta** - downloads meta data regarding a single data set
* **ds_list** - downloads a list of data sets in your Domo instance
* **ds_delete** - deletes a data set (be careful)
* **ds_query** - allows you to send a query to a data set, Domo will evaluate that query and sends the results back as a list or a tibble
* **Groups** - This set of functions modifies and creates groups.
* **groups_add_users** - adds users to an existing group
* **groups_create** - create a group
* **groups_delete** - delete an existing group
* **groups_list** - list all groups
* **groups_remove_users** - remove users from a group
* **groups_list_users** - list users in a group
* **Pages** - functions related to managing Domo pages
* **page_update** - update a page
* **page_list** - list all pages
* **page_get_collections** - list all collections on a page
* **page_get** - get information regarding a page
* **page_create** - create a page
* **PDP** - functions to manage PDP
* **pdp_update** - update an existing PDP policy
* **pdp_list** - list all PDP policies
* **pdp_enable** - toggle PDP on and off
* **pdp_delete** - delete a PDP policy
* **pdp_create** - create a PDP policy
* **Users** - functions to manage users
* **users_delete** - delete a user
* **users_update** - update a user
* **users_list** - list all users
* **users_get** - get a single user record
* **users_add** - create a user (or users)