{"library":"pantab","title":"Pantab: Pandas DataFrames to Tableau Hyper Extracts","description":"Pantab is a Python library that enables seamless conversion between pandas DataFrames and Tableau Hyper Extracts (.hyper files). It provides a high-performance way to get data into and out of Tableau's Hyper engine, which is used for data storage and querying within Tableau products. The current version is 5.3.0, and it generally follows a release cadence with minor versions every few months, often including bug fixes and Python version support updates.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pantab"],"cli":null},"imports":["from pantab import to_hyper","from pantab import frame_from_hyper"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pandas as pd\nimport pantab as pt\nimport os\n\ndata = {\n    'col1': [1, 2, 3],\n    'col2': ['A', 'B', 'C'],\n    'col3': [True, False, True]\n}\ndf = pd.DataFrame(data)\n\nhyper_file = 'my_data.hyper'\ntable_name = 'MyTable'\n\ntry:\n    # Write DataFrame to Hyper file\n    pt.to_hyper(df, hyper_file, table=table_name)\n    print(f\"DataFrame written to {hyper_file} successfully.\")\n\n    # Read DataFrame from Hyper file\n    read_df = pt.frame_from_hyper(hyper_file, table=table_name)\n    print(f\"DataFrame read from {hyper_file} successfully:\")\n    print(read_df)\n\nfinally:\n    # Clean up the generated file\n    if os.path.exists(hyper_file):\n        os.remove(hyper_file)\n        print(f\"Cleaned up {hyper_file}.\")","lang":"python","description":"This quickstart demonstrates how to create a pandas DataFrame, write it to a Tableau Hyper file using `pantab.to_hyper`, and then read it back into a DataFrame using `pantab.frame_from_hyper`. It includes cleanup to remove the generated Hyper file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}