Registry / database / tableauhyperapi

tableauhyperapi

JSON →
library0.0.26359pypypi✓ verified 22d ago

The Tableau Hyper API for Python allows developers to programmatically create, read, and update .hyper files, which are Tableau's high-performance data engine files. It provides direct interaction with the Hyper engine for efficient data management and integration with Tableau products. The current version is 0.0.24457, and it is actively maintained with frequent updates.

pip install tableauhyperapi
INSTALL
IMPORT
SIG · TABLEAUHYPERAPI
T
tableauhyperapi
databasepythonv0.0.26359
Install
4.0s avg
Import
64ms
Disk
304MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.26359 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.064s · 306MB
304MB installed
● package 304MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HyperProcess
from tableauhyperapi import HyperProcess
Connection
from tableauhyperapi import Connection
TableDefinition
from tableauhyperapi import TableDefinition
TableDefinition.Column
from tableauhyperapi import TableDefinition, SqlType; column = TableDefinition.Column("name", SqlType.text())
SqlType
from tableauhyperapi import SqlType
TableName
from tableauhyperapi import TableName
Inserter
from tableauhyperapi import Inserter

This quickstart demonstrates how to initialize a HyperProcess, establish a connection to a .hyper file, define a table schema, create the table, and insert data into it. It emphasizes proper resource management using `with` statements to ensure connections and the Hyper process are correctly closed.

import os from tableauhyperapi import HyperProcess, Connection, TableDefinition, TableName, SqlType, Inserter # Define the path for the new Hyper file hyper_file_path = 'my_first_hyper_file.hyper' # Remove the file if it already exists to start fresh if os.path.exists(hyper_file_path): os.remove(hyper_file_path) # 1. Start the HyperProcess with HyperProcess(telemetry_opt_out=True) as hyper: print(f"The HyperProcess has started on port {hyper.endpoint.port}.") # 2. Connect to the Hyper file (creates it if it doesn't exist) with Connection(endpoint=hyper.endpoint, database=hyper_file_path, create_mode=Connection.CreateMode.CREATE_AND_REPLACE) as connection: print("The connection to the Hyper file is open.") # 3. Define the table schema table_name = TableName('public', 'my_data_table') table_definition = TableDefinition( table_name, [ TableDefinition.Column('id', SqlType.int()), TableDefinition.Column('name', SqlType.text()), TableDefinition.Column('value', SqlType.double()), ] ) # 4. Create the table connection.catalog.create_table(table_definition) print(f"Table '{table_name}' created.") # 5. Insert data with Inserter(connection, table_definition) as inserter: inserter.add_row([1, 'Alpha', 10.5]) inserter.add_row([2, 'Beta', 20.3]) inserter.add_row([3, 'Gamma', 30.1]) inserter.execute() print(f"{inserter.number_of_inserted_rows} rows inserted.") print("The connection to the Hyper file is closed.") print("The HyperProcess is shut down.") print(f"Hyper file '{hyper_file_path}' created successfully.")
Debug
Known issues
gotchaAlways use `with` statements for `HyperProcess` and `Connection` to ensure resources (file locks, server processes) are properly released, even if errors occur. Failing to do so can lead to file corruption, locked files, or orphaned Hyper processes.
fix
Wrap `HyperProcess` and `Connection` in `with` statements (e.g., `with HyperProcess(...) as hyper: ...`) to automate resource cleanup.
affects: All versions
gotchaIncorrect mapping between Python data types and Hyper's `SqlType` can lead to errors during insertion or unexpected data behavior (e.g., truncation, incorrect interpretation).
fix
Carefully consult the `SqlType` documentation to ensure Python types (e.g., `int`, `str`, `float`, `datetime.datetime`) are mapped to their appropriate Hyper SQL equivalents (e.g., `SqlType.int()`, `SqlType.text()`, `SqlType.double()`, `SqlType.timestamp()`).
affects: All versions
gotchaThe `HyperProcess` may fail to start if the default port is already in use or if the underlying Hyper engine executable cannot be found or executed. This often manifests as connection errors or process termination.
fix
Check for other running Hyper processes, specify a different port when initializing `HyperProcess` (e.g., `HyperProcess(endpoint=Endpoint(port=12345))`), and ensure system permissions allow the Hyper executable to run. Inspect Hyper process logs for detailed error messages.
affects: All versions
gotchaWhen referencing tables, it's best practice to always specify both the schema and table name using `TableName('schema', 'table')` (e.g., `TableName('public', 'my_table')`). Omitting the schema can lead to ambiguity or unexpected behavior, especially in environments with multiple schemas.
fix
Explicitly define `TableName` with both schema and table name, for example: `TableName('public', 'my_data')`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tableauhyperapi'
The `tableauhyperapi` package is not installed in the Python environment where the script is being executed.
fix
pip install tableauhyperapi
TableauException: "Cannot open hyper file '<path_to_file>.hyper'"
The Hyper file cannot be accessed, possibly due to an incorrect file path, insufficient file permissions, the file being locked by another process, or corruption.
fix
Verify the file path, check file permissions, ensure no other process (like Tableau Desktop) is accessing the file, and confirm the file is not corrupted.
TableauException: "The table with name 'Extract' does not exist."
The specified table name does not exist within the Hyper file, often due to a typo in the table name or forgetting to explicitly create the table before attempting to interact with it.
fix
Double-check the exact table name used and ensure the table schema has been properly defined and created in the Hyper file using `TableDefinition` and `create_table()`.
TableauException: "Column 'ID' does not exist in table 'Extract'."
The specified column name does not match any existing column in the target table's schema within the Hyper file, commonly caused by a typo or a mismatch with the table definition.
fix
Review the table's schema definition (e.g., `table_definition.add_column(...)`) and ensure the column name in your code exactly matches an existing column in the table.
Upgrade
Version history
0.0.26359latest on PyPI · released Aug 24, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
28
OpenAI (training)
1
Resources
tableauhyperapi — pip install tableauhyperapi · libregistry