Skip to content

joseacortez91/hyper-api-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating Tableau extracts programatically


This code example uses Tableau APIs to illustrate how to accomplish the following:

  1. Fetch data from a PostgreSQL table
  2. Generate a .hyper file
  3. Publish the .hyper file to Tableau Cloud/Server

Creating extracts programatically is a requirement that manifests itself into many real-world use-cases. Tableau customers continue to need automation capabilities as their business & security requirements evolve.

For example, a business may wish to allow external users the ability to upload data to an external-facing web application (customer portal/partner app/etc.) they manage and make that data available in Tableau Embedded Analytics for consumption seamlessly without forcing the end user to toggle between multiple applications.

Or another example, many Embedded Analytics scenarios involve Single Tenant data architectures where each customer/client/tenant's data is stored in its own data store/set of database tables, aka physical or logical partitioning. You will need a mechanism to take each tenant's data and publish it for use in Tableau and update it as the source data changes. One way to accomplish this is to take advantage of Tableau's hyper fast SQL engine and APIs.





At a high level, you will need to run through the following steps:

  1. Install all dependencies including PostgreSQL, psycopg2, Tableau Hyper API, Tableau Server Client
  2. Create a database in PostgreSQL & import Superstore.csv into a database table named "Superstore"
  3. Create a database user and asign them reading permissions on the database table
  4. Generate a Tableau Personal Access Token
  5. Make code edits to the build-extract.py file in the following places (enter your information):
    • line 15 - database name
    • line 15 - database username
    • line 15 - database password
    • line 85 - tableau personal access token name
    • line 85 - tableau personal access token secret
    • line 85 - tableau server/cloud site name
    • line 86 - tableau server/cloud domain
    • line 96 - tableau project name


IMPORTANT: The code provided in this repository is by no means production-ready code and is only intended to be used for testing/demo purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages