Website • Demo • Documentation • Chat
A Python script pulls and parses XML data from PSQL readonly Tableau database. This data, along with data pulled from Tableau's database, is inserted into a SQL database and is able to be run daily and inserted into Atlas.
.twbx
and .twb
files containing SQL queries related to the workbooks stored in TableauTwbxFiles
folder and any zipped folders are unzippedgit clone [email protected]:atlas-bi/Tableau-Metadata-Exporter.git
create_tables.sql
script in your atlas_staging
databasepoetry install
, or pip install
the dependencies listed in the pyproject.toml
filepoetry run python main.py
, or python main.py
The python script accepts environment variables. This is the recommended way to run the script. You can also create a .env
file to hold the parameters.
# Tableau's psql admin account. Documentation on Tabeau's website for getting the admin password.
PSQLADMIN=postgres://tblwgadmin:password@localhost:8060/workgroup
# Tableau's psql ro account
PSQLRO=postgres://readonly:password@hostname:8060/workgroup
# Atlas Staging database connection
SQLSERVER=DRIVER={ODBC Driver 17 for SQL Server};SERVER=sqlServer;DATABASE=atlas_staging;UID=joe;PWD=12345
# SSH Connection to Tableau Server. Old servers will need to install OpenSSH
SSHHOST=tableauServer
SSHUSERNAME=mr_cool
SSHPASSWORD=12345
# Url to Tableau
TABLEAUURL=https://tableau.example.com
Here’s a few steps to get the Tableau PSQL admin and readonly passwords.
Navigate to the Tableau server and open command prompt.
cd C:\Program Files\Tableau\Tableau Server\packages\pgsql.<version>\bin
#to retrieve the Tableau admin password
tsm configuration get -k pgsql.adminpassword
#to retrieve the readonly password
tsm configuration get -k pgsql.readonly_password
Some of the PSQL queries that are run look at user and group data. To access these tables, try this guide. The user data is mostly found in the ts_users data source.
For a list of nearly all Tableau tables along with columns and descriptions, try this guide.