DEV Community

Jakub T
Jakub T

Posted on

3 1

Accessing Tableau with Python

You can find the Tableau SDK Python docs: https://tableau.github.io/server-client-python/docs/

In order to be able to refresh the Datasources you need to get their ids:

import tableauserverclient as TSC


USERNAME = ''
PASSWORD = ''
SITE_ID  = ''


tableau_auth = TSC.TableauAuth(USERNAME, PASSWORD, site_id=SITE_ID)
server = TSC.Server('https://dub01.online.tableau.com')
server.auth.sign_in(tableau_auth)

datasources, _ = server.datasources.get()

tags_to_refresh = {'production'}

# We want to refresh only the datasources with the production tag

datasource_ids = [datasource.id for datasource in datasources if (datasource.tags & tags_to_refresh)]

for datasource_id in datasource_ids:
    item = server.datasources.get_by_id(datasource_id)
    result = server.datasources.refresh(item)
    print(result)

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (1)

Collapse
 
aza profile image
Aza

Thank you!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay