问题
Is there a way to refresh Tableau dashboards using Python? I need to refresh Tableau dashboards after my data is loaded into DB.
回答1:
The Tableau REST API will allow you to refresh your extracts via Python.
Here is an example of a script which should get you started:
import tableauserverclient as TSC
tableau_auth = TSC.TableauAuth(user, password)
server = TSC.Server('Address')
server.version = '2.3'
resource_id= 6109
with server.auth.sign_in(tableau_auth):
print('connection made')
print(server.version)
#resource = server.workbooks.get_by_id(resource_id)
server.workbooks.refresh(workbook_id='6109')
server.auth.sign_out()
print('connection closed')
来源:https://stackoverflow.com/questions/55654289/tableau-dashboard-refresh-using-python