# tableau/tabpy architecture

> Architecture diagram of the GitHub repository tableau/tabpy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tableau/tabpy
- Repository: https://github.com/tableau/tabpy

## Overview

TabPy is a Tableau Analytics Extension server: Tableau sends table-calculation requests to the server, which dispatches them to saved Python functions and returns results. The repository also provides endpoint management, evaluation, authentication, Arrow Flight, and Python client tools. The graph follows explicit README claims and shown calls/import references; unsampled route and storage details are kept at subsystem level where wiring is not evidenced.

Main entry points: [`tabpy/tabpy_server/app/app.py`](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/app.py) (Application server), [`tabpy/tabpy_server/psws/callbacks.py`](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/callbacks.py) (State callbacks), [`tabpy/tabpy_server/psws/python_service.py`](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/python_service.py) (Python service), [`tabpy/tabpy_server/management/state.py`](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/management/state.py) (Endpoint state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_cli["Server entrypoint<br/>[tabpy.py]"]
  node_app["Application server<br/>[app.py]"]
  node_config["Server settings<br/>[app_parameters.py]"]
end

subgraph group_execution["Python execution"]
  node_query["Query API"]
  node_evaluation["Evaluation API"]
  node_python_service["Python service<br/>[python_service.py]"]
  node_query_object["Query objects<br/>[query_object.py]"]
  node_arrow["Arrow Flight<br/>[arrow_server.py]"]
end

subgraph group_management["Endpoint management"]
  node_management_api["Management API"]
  node_endpoint_api["Endpoint API"]
  node_state[("Endpoint state<br/>[state.py]")]
  node_callbacks["State callbacks<br/>[callbacks.py]"]
  node_endpoint_files["Endpoint files"]
end

subgraph group_security["Security"]
  node_auth_handlers["Request authentication<br/>[base_handler.py]"]
  node_jwt["JWT validation<br/>[jwt_auth.py]"]
end

subgraph group_clients["Client tools"]
  node_client["Python client<br/>[client.py]"]
  node_rest_client["REST transport<br/>[rest_client.py]"]
end

node_tableau(("Tableau"))

node_tableau -->|"sends calculations"| node_query
node_cli -->|"starts"| node_app
node_app -->|"uses settings"| node_config
node_app -->|"initializes"| node_python_service
node_app -->|"initializes"| node_callbacks
node_app -->|"registers handlers"| node_auth_handlers
node_query -->|"queries"| node_python_service
node_python_service -->|"executes objects"| node_query_object
node_app -->|"starts server"| node_arrow
node_management_api -->|"manages endpoints"| node_state
node_endpoint_api -->|"updates endpoints"| node_state
node_callbacks -->|"reads state"| node_state
node_callbacks -->|"cleans files"| node_endpoint_files
node_callbacks -->|"dispatches changes"| node_python_service
node_auth_handlers -->|"validates tokens"| node_jwt
node_client -->|"uses transport"| node_rest_client

click node_cli "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy.py"
click node_app "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/app.py"
click node_config "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/app_parameters.py"
click node_query "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/query_plane_handler.py"
click node_evaluation "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/evaluation_plane_handler.py"
click node_python_service "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/python_service.py"
click node_query_object "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/query_object.py"
click node_arrow "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/arrow_server.py"
click node_management_api "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/management_handler.py"
click node_endpoint_api "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/endpoint_handler.py"
click node_state "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/management/state.py"
click node_callbacks "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/callbacks.py"
click node_endpoint_files "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/common/endpoint_file_mgr.py"
click node_auth_handlers "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/base_handler.py"
click node_jwt "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/jwt_auth.py"
click node_client "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/client.py"
click node_rest_client "https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/rest_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_app,node_config toneBlue
class node_query,node_evaluation,node_python_service,node_query_object,node_arrow toneAmber
class node_management_api,node_endpoint_api,node_state,node_callbacks,node_endpoint_files toneMint
class node_auth_handlers,node_jwt toneRose
class node_client,node_rest_client,node_tableau toneIndigo
```

## Components

### Server runtime

- [Server entrypoint](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy.py): `tabpy/tabpy.py`
- [Application server](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/app.py): `tabpy/tabpy_server/app/app.py`
- [Server settings](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/app_parameters.py): `tabpy/tabpy_server/app/app_parameters.py`

### Python execution

- [Query API](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/query_plane_handler.py): `tabpy/tabpy_server/handlers/query_plane_handler.py`
- [Evaluation API](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/evaluation_plane_handler.py): `tabpy/tabpy_server/handlers/evaluation_plane_handler.py`
- [Python service](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/python_service.py): `tabpy/tabpy_server/psws/python_service.py`
- [Query objects](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/query_object.py): `tabpy/tabpy_tools/query_object.py`
- [Arrow Flight](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/app/arrow_server.py): `tabpy/tabpy_server/app/arrow_server.py`

### Endpoint management

- [Management API](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/management_handler.py): `tabpy/tabpy_server/handlers/management_handler.py`
- [Endpoint API](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/endpoint_handler.py): `tabpy/tabpy_server/handlers/endpoint_handler.py`
- [Endpoint state](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/management/state.py): `tabpy/tabpy_server/management/state.py`
- [State callbacks](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/psws/callbacks.py): `tabpy/tabpy_server/psws/callbacks.py`
- [Endpoint files](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/common/endpoint_file_mgr.py): `tabpy/tabpy_server/common/endpoint_file_mgr.py`

### Security

- [Request authentication](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/base_handler.py): `tabpy/tabpy_server/handlers/base_handler.py`
- [JWT validation](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_server/handlers/jwt_auth.py): `tabpy/tabpy_server/handlers/jwt_auth.py`

### Client tools

- [Python client](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/client.py): `tabpy/tabpy_tools/client.py`
- [REST transport](https://github.com/tableau/tabpy/blob/master/tabpy/tabpy_tools/rest_client.py): `tabpy/tabpy_tools/rest_client.py`

### Other components

- **Tableau**

## Connections

- Tableau → Query API: sends calculations
- Server entrypoint → Application server: starts (evidence: `tabpy/tabpy.py`)
- Application server → Server settings: uses settings (evidence: `tabpy/tabpy_server/app/app.py`)
- Application server → Python service: initializes (evidence: `tabpy/tabpy_server/app/app.py`)
- Application server → State callbacks: initializes (evidence: `tabpy/tabpy_server/app/app.py`)
- Application server → Request authentication: registers handlers (evidence: `tabpy/tabpy_server/app/app.py`)
- Query API → Python service: queries (evidence: `tabpy/tabpy_server/handlers/query_plane_handler.py`)
- Python service → Query objects: executes objects (evidence: `tabpy/tabpy_server/psws/python_service.py`)
- Application server → Arrow Flight: starts server (evidence: `tabpy/tabpy_server/app/app.py`)
- Management API → Endpoint state: manages endpoints (evidence: `tabpy/tabpy_server/handlers/management_handler.py`)
- Endpoint API → Endpoint state: updates endpoints (evidence: `tabpy/tabpy_server/handlers/endpoint_handler.py`)
- State callbacks → Endpoint state: reads state (evidence: `tabpy/tabpy_server/psws/callbacks.py`)
- State callbacks → Endpoint files: cleans files (evidence: `tabpy/tabpy_server/psws/callbacks.py`)
- State callbacks → Python service: dispatches changes (evidence: `tabpy/tabpy_server/psws/callbacks.py`)
- Request authentication → JWT validation: validates tokens (evidence: `tabpy/tabpy_server/handlers/base_handler.py`)
- Python client → REST transport: uses transport (evidence: `tabpy/tabpy_tools/client.py`)
