Querying Tableau Server for exporting a view using python and REST API

0 votes

I'm trying to use Python to export a tableau view as an image/csv (it doesn't matter). I did some research and discovered that REST API would be useful in this situation, so I created a Personal Access Token and used the following command to connect: -

import tableauserverclient as TSC
from tableau_api_lib import TableauServerConnection
from tableau_api_lib.utils.querying import get_views_dataframe, get_view_data_dataframe

server_url = 'https://tableau.mariadb.com'
site = ''
mytoken_name = 'Marine'
mytoken_secret = '$32mcyTOkmjSFqKBeVKEZYpMUexseV197l2MuvRlwHghMacCOa'

server = TSC.Server(server_url, use_server_version=True)
tableau_auth = TSC.PersonalAccessTokenAuth(token_name=mytoken_name, personal_access_token=mytoken_secret, site_id=site)
with server.auth.sign_in_with_personal_access_token(tableau_auth):
    print('[Logged in successfully to {}]'.format(server_url))

Got a message after enter :

[Logged in successfully to https://tableau.mariadb.com]

However, I am at a loss now on how to access the tableau workbooks using Python. I searched here:-

https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm

but was unable to write these commands like GET or others in python.

Can anyone help me with this?

Apr 14, 2022 in Tableau by Neha
• 9,020 points
1,769 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Tableau

+1 vote
1 answer

How to authenticate and embed Tableau Rest API using Python 2.7

Your .format() call is creating a bad ...READ MORE

answered Jul 19, 2018 in Tableau by Atul
• 10,240 points
2,860 views
0 votes
1 answer

Tableau download/export images using Rest api python

The easiest method is to send an ...READ MORE

answered Apr 5, 2022 in Tableau by Neha
• 9,020 points
1,089 views
0 votes
1 answer

Do I need a license for Tableau Server to publish content from Tableau Desktop to the Server?

According to this setup you do not ...READ MORE

answered Apr 17, 2018 in Tableau by xyz
• 1,560 points
1,079 views
0 votes
1 answer
0 votes
1 answer

Search values in a sheet for a field and display in tableau

Hi Sindhu, Follow below steps: 1. Create a parameter ...READ MORE

answered Apr 3, 2019 in Tableau by Cherukuri
• 33,030 points
1,230 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP