I want to convert a Tableau .hyper file to a pandas dataframe. It is possible to convert a dataframe to a .hyper file, but unfortunately, I could not come up with a solution for this problem. How can you achieve this with python?
3 Answers
The accepted answer is outdated. You no longer need to use Tableau Desktop, you can now read .hyper
files directly.
In October, we released the new Hyper API, which can read .hyper
files in Python.
Subsequently, the pantab library was updated to use Hyper API and is now also able to read data frames from a .hyper
file. Thus, you can now use its frame_from_hyper
method to do that:
result = pantab.frame_from_hyper(database=<PATH TO YOUR HYPER FILE>, table=<TABLE INSIDE THE HYPER FILE>)
If you don't know the name of the table insider your .hyper
file or if you have multiple tables in your file, you can also use frames_from_hyper
, which will give you a dictionary { table name -> data frame }, i.e., one frame for each table in the file:
result = pantab.frames_from_hyper(database=<PATH TO YOUR HYPER FILE>)

- 38,535
- 21
- 92
- 152
-
I updated the previous accepted answer based on the new API features. Feel free to improve it – Alex Blakemore Jul 21 '20 at 16:54
-
After getting dictionary { table name -> data frame }, is there a way to extract the dataframe out of it? – Shashank Apr 10 '21 at 16:35
-
Check a pantab library:
def frame_from_hyper(fn, table='Extract'):
"""
Extracts a DataFrame from a .hyper extract.
"""
EDIT - this function was not originally implemented in pantab, but has since been added

- 11,301
- 2
- 26
- 49

- 1,174
- 4
- 19
- 42
For a one-time conversion, you can connect to the hyper extract with Tableau Desktop, and then export to CSV from the data menu.
If you want to automate a repeatable process that doesn't require manually using Tableau Desktop, have your data provider supply the data in CSV or another format.
Tableau did not initially provide a public API to read from hyper extracts, just to create them. (Presumably, they preferred that people use Tableau to read from the extracts.)
In late 2019, Tableau released an extended Hyper API that now allows programs to read from Hyper extracts
Still Tableau extracts are usually used as efficient mirrors of an original data source - not as a definitive source - much like a materialized view in a database reflects underlying tables. As the API matures, other uses cases may get more prominent.
Two other options to explore depending on your use case that can let you generate Tableau extracts under program control.

- 11,301
- 2
- 26
- 49
-
For clarification: I want to avoid creating and refreshing extracts from Tableau Server and automate the process. On Tableau Desktop you can incremental refresh your extract by identifying a specific column. Thats what I want to do programmatically with python given a .hyper file. – btinman Apr 09 '19 at 05:12
-
I edited the answer to link to a couple of options that allow you to automate extract creation/refresh without using Tableau server. – Alex Blakemore Apr 09 '19 at 14:41