The unified Python SDK for Tableau workbook engineering
Project description
pytableau
What pandas did for tabular data, pytableau does for Tableau workbooks.
pytableau is the unified Python SDK for Tableau workbook engineering. It brings every layer of Tableau workbook manipulation — data, connections, semantic model, presentation, packaging, and server lifecycle — under one coherent, Pythonic API.
Why pytableau?
The Tableau Python ecosystem is fragmented. Tableau/Salesforce maintains several narrow libraries, each covering a single concern:
| Library | Layer | Limitation |
|---|---|---|
tableaudocumentapi |
Connection XML | No calc fields, no viz edits, abandoned 2021 |
tableauhyperapi |
.hyper data files |
No XML awareness |
pantab |
DataFrame ↔ .hyper bridge |
No XML awareness |
tableauserverclient |
Server REST API | No local file manipulation |
pytableau wraps and integrates all of them behind a single API.
Install
# Core (XML + ZIP only — no optional dependencies)
pip install pytableau
# With Hyper / extract support
pip install "pytableau[hyper]"
# With pandas convenience methods
pip install "pytableau[pandas]"
# With Tableau Server/Cloud integration
pip install "pytableau[server]"
# Everything
pip install "pytableau[all]"
Quick Start
Open and inspect a workbook
from pytableau import Workbook
wb = Workbook.open("sales_dashboard.twbx")
print(wb.version) # "2024.1"
print(wb.datasources.names) # ["Sales Data", "Parameters"]
print(wb.worksheets.names) # ["Revenue by Region", "Trend"]
print(wb.dashboards.names) # ["Executive Summary"]
catalog = wb.catalog()
for field in catalog.calculated_fields:
print(f"{field.caption}: {field.formula}")
Swap database connections (CI/CD promotion)
from pytableau import Workbook
wb = Workbook.open("report.twbx")
for ds in wb.datasources:
for conn in ds.connections:
conn.server = "prod-db.corp.com"
conn.dbname = "analytics_prod"
wb.save_as("report_prod.twbx")
Inject a DataFrame
from pytableau import Workbook
import pandas as pd
wb = Workbook.open("template.twbx")
df = pd.read_csv("fresh_data.csv")
wb.datasources["Sales Data"].hyper.from_dataframe(df)
wb.save_as("refreshed_report.twbx")
Generate a workbook from a template
from pytableau import Workbook
import pandas as pd
df = pd.read_csv("q4_revenue.csv")
wb = Workbook.from_template("bar_chart")
wb.datasources["__PLACEHOLDER_DS__"].hyper.from_dataframe(df)
wb.template.map_fields({
"__DIMENSION__": "Product Category",
"__MEASURE__": "Revenue",
"__COLOR__": "Region",
})
wb.parameters["__PARAM_TITLE__"].value = "Q4 2025 Revenue"
wb.save_as("q4_report.twbx")
CLI
pytableau inspect workbook.twbx
pytableau diff before.twb after.twb
pytableau swap workbook.twb --server prod-db.corp.com --db analytics_prod
Development Status
| Phase | Description | Status |
|---|---|---|
| 0 | Foundation: scaffolding, packaging, constants | In Progress |
| 1 | Read & Inspect: parse any .twb/.twbx |
Planned |
| 2 | Connection & Field Mutation | Planned |
| 3 | Data Layer: .hyper integration |
Planned |
| 4 | Template Engine | Planned |
| 5 | Server Integration | Planned |
| 6 | Advanced Features | Planned |
Design Principles
- Layer cake, not monolith. Each Tableau layer maps to a distinct submodule. Engage at any abstraction level.
- Batteries included, escape hatches available. The Pythonic API covers 90% of use cases; raw
lxmlnodes are always accessible. - Template-first for presentation. Build a viz in Desktop, then parameterize it with pytableau.
- Fail loud, fail early. Validate XML mutations before writing — a corrupt
.twbis the worst outcome. - Dependency-light by default. Core requires only
lxml. Hyper, server, and pandas are optional extras. - Version-aware. Track Tableau Desktop version; warn on incompatible XML.
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytableau-1.0.0.tar.gz.
File metadata
- Download URL: pytableau-1.0.0.tar.gz
- Upload date:
- Size: 298.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3110a4127df10684b483f72ac0060120ac12e7bb35d5037f8ae799f5c415139
|
|
| MD5 |
bac6c03bee2f7bf806b98b78bfc8ac33
|
|
| BLAKE2b-256 |
301b71eac785efccc025d8c1f6682a7acee76c7554b45db91ba051daa525f2b4
|
Provenance
The following attestation bundles were made for pytableau-1.0.0.tar.gz:
Publisher:
publish.yml on weisberg/pytableau
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytableau-1.0.0.tar.gz -
Subject digest:
c3110a4127df10684b483f72ac0060120ac12e7bb35d5037f8ae799f5c415139 - Sigstore transparency entry: 984537590
- Sigstore integration time:
-
Permalink:
weisberg/pytableau@d4f6d09fe87acb62832ae1d12898de2573225542 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/weisberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d4f6d09fe87acb62832ae1d12898de2573225542 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pytableau-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pytableau-1.0.0-py3-none-any.whl
- Upload date:
- Size: 116.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aeb0d538c573795c5fa92151a586229378a1dfddce40f581db9ed67ccae61f9
|
|
| MD5 |
c578ec0e3b812f3bfbf65c5f9259ecb3
|
|
| BLAKE2b-256 |
0047054d5bfda73a50fb506862a1f616646a41cfcb08609120be869332385ea1
|
Provenance
The following attestation bundles were made for pytableau-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on weisberg/pytableau
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytableau-1.0.0-py3-none-any.whl -
Subject digest:
0aeb0d538c573795c5fa92151a586229378a1dfddce40f581db9ed67ccae61f9 - Sigstore transparency entry: 984537631
- Sigstore integration time:
-
Permalink:
weisberg/pytableau@d4f6d09fe87acb62832ae1d12898de2573225542 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/weisberg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d4f6d09fe87acb62832ae1d12898de2573225542 -
Trigger Event:
workflow_dispatch
-
Statement type: