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?
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>)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With