# palantir/foundry-platform-python architecture

> Architecture diagram of the GitHub repository palantir/foundry-platform-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/palantir/foundry-platform-python
- Repository: https://github.com/palantir/foundry-platform-python

## Overview

The Foundry Platform SDK is a generated Python client for Foundry’s versioned APIs. Users configure a client with authentication and a hostname, select an API resource, and invoke operations such as creating a dataset branch or querying data; responses and errors are handled through shared runtime infrastructure. The graph preserves the major API domains listed in the repository tree and README. Some domain internals are unsampled, so edges reflect only README statements or source-index references, not inferred domain-to-domain workflows.

Main entry points: [`foundry_sdk/v2/client.py`](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/v2/client.py) (Versioned clients), [`foundry_sdk/_core/api_client.py`](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/api_client.py) (API transport), [`foundry_sdk/_core/auth_utils.py`](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/auth_utils.py) (Authentication), [`foundry_sdk/v2/datasets`](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/datasets) (Datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client setup"]
  node_client["Versioned clients<br/>[client.py]"]
  node_setup["Client configuration"]
  node_auth["Authentication<br/>[auth_utils.py]"]
  node_userauth["User token auth"]
  node_confidential["OAuth client auth"]
  node_public["Public client auth"]
  node_computeauth["Pipeline auth"]
  node_hostname["Hostname resolution"]
end

subgraph group_runtime["Shared runtime"]
  node_transport["API transport<br/>[api_client.py]"]
  node_models["Shared models<br/>[models.py]"]
  node_errors["Error handling"]
end

subgraph group_data["Data and ontology"]
  node_datasets["Datasets"]
  node_ontology["Ontology resources"]
  node_functions["Functions and queries"]
  node_sql["SQL queries"]
  node_filesystem["Filesystem"]
end

subgraph group_platform["Platform APIs"]
  node_admin["Administration"]
  node_agents["AI agents and models"]
  node_orchestration["Orchestration"]
  node_connectivity["Connectivity and streams"]
  node_otherapis["Other API domains"]
end

node_developer(("SDK user"))
node_foundry(("Foundry API"))

node_developer -->|"initializes"| node_client
node_client -->|"resolves settings"| node_setup
node_client -->|"creates namespace"| node_admin
node_client -->|"creates namespace"| node_agents
node_client -->|"creates namespace"| node_orchestration
node_client -->|"creates namespace"| node_connectivity
node_client -->|"creates namespace"| node_datasets
node_client -->|"creates namespace"| node_filesystem
node_client -->|"creates namespace"| node_functions
node_client -->|"creates namespace"| node_ontology
node_client -->|"creates namespace"| node_sql
node_client -->|"exposes namespaces"| node_otherapis
node_setup -->|"selects auth"| node_auth
node_setup -->|"resolves hostname"| node_hostname
node_userauth -->|"implements"| node_auth
node_confidential -->|"implements"| node_auth
node_public -->|"implements"| node_auth
node_computeauth -->|"implements"| node_auth
node_datasets -.->|"uses"| node_transport
node_ontology -.->|"uses"| node_transport
node_functions -->|"uses"| node_transport
node_sql -->|"uses"| node_transport
node_filesystem -.->|"uses"| node_transport
node_admin -.->|"uses"| node_transport
node_agents -.->|"uses"| node_transport
node_orchestration -.->|"uses"| node_transport
node_connectivity -.->|"uses"| node_transport
node_transport -.->|"sends API requests"| node_foundry
node_developer -->|"creates branch"| node_datasets
node_ontology -.->|"accesses resources"| node_foundry
node_datasets -.->|"uses schemas"| node_models
node_transport -.->|"raises API errors"| node_errors

click node_client "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/v2/client.py"
click node_setup "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/client_init_helpers.py"
click node_auth "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/auth_utils.py"
click node_userauth "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/user_token_auth_client.py"
click node_confidential "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/confidential_client_auth.py"
click node_public "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/public_client_auth.py"
click node_computeauth "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/compute_module_pipeline_auth.py"
click node_hostname "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/hostname_supplier.py"
click node_transport "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/api_client.py"
click node_models "https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/v2/core/models.py"
click node_errors "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/_errors"
click node_datasets "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/datasets"
click node_ontology "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/ontologies"
click node_functions "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/functions"
click node_sql "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/sql_queries"
click node_filesystem "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/filesystem"
click node_admin "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/admin"
click node_agents "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/aip_agents"
click node_orchestration "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/orchestration"
click node_connectivity "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/connectivity"
click node_otherapis "https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2"

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_client,node_setup,node_auth,node_userauth,node_confidential,node_public,node_computeauth,node_hostname,node_developer toneBlue
class node_transport,node_models,node_errors toneAmber
class node_datasets,node_ontology,node_functions,node_sql,node_filesystem,node_foundry toneMint
class node_admin,node_agents,node_orchestration,node_connectivity,node_otherapis toneRose
```

## Components

### Client setup

- [Versioned clients](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/v2/client.py): `foundry_sdk/v2/client.py`
- [Client configuration](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/client_init_helpers.py): `foundry_sdk/_core/client_init_helpers.py`
- [Authentication](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/auth_utils.py): `foundry_sdk/_core/auth_utils.py`
- [User token auth](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/user_token_auth_client.py): `foundry_sdk/_core/user_token_auth_client.py`
- [OAuth client auth](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/confidential_client_auth.py): `foundry_sdk/_core/confidential_client_auth.py`
- [Public client auth](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/public_client_auth.py): `foundry_sdk/_core/public_client_auth.py`
- [Pipeline auth](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/compute_module_pipeline_auth.py): `foundry_sdk/_core/compute_module_pipeline_auth.py`
- [Hostname resolution](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/hostname_supplier.py): `foundry_sdk/_core/hostname_supplier.py`

### Shared runtime

- [API transport](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/_core/api_client.py): `foundry_sdk/_core/api_client.py`
- [Shared models](https://github.com/palantir/foundry-platform-python/blob/develop/foundry_sdk/v2/core/models.py): `foundry_sdk/v2/core/models.py`
- [Error handling](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/_errors): `foundry_sdk/_errors`

### Data and ontology

- [Datasets](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/datasets): `foundry_sdk/v2/datasets`
- [Ontology resources](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/ontologies): `foundry_sdk/v2/ontologies`
- [Functions and queries](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/functions): `foundry_sdk/v2/functions`
- [SQL queries](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/sql_queries): `foundry_sdk/v2/sql_queries`
- [Filesystem](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/filesystem): `foundry_sdk/v2/filesystem`

### Platform APIs

- [Administration](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/admin): `foundry_sdk/v2/admin`
- [AI agents and models](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/aip_agents): `foundry_sdk/v2/aip_agents`
- [Orchestration](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/orchestration): `foundry_sdk/v2/orchestration`
- [Connectivity and streams](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2/connectivity): `foundry_sdk/v2/connectivity`
- [Other API domains](https://github.com/palantir/foundry-platform-python/tree/develop/foundry_sdk/v2): `foundry_sdk/v2`

### Other components

- **SDK user**
- **Foundry API**

## Connections

- SDK user → Versioned clients: initializes
- Versioned clients → Client configuration: resolves settings (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Administration: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → AI agents and models: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Orchestration: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Connectivity and streams: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Datasets: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Filesystem: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Functions and queries: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Ontology resources: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → SQL queries: creates namespace (evidence: `foundry_sdk/v2/client.py`)
- Versioned clients → Other API domains: exposes namespaces (evidence: `foundry_sdk/v2/client.py`)
- Client configuration → Authentication: selects auth (evidence: `foundry_sdk/_core/client_init_helpers.py`)
- Client configuration → Hostname resolution: resolves hostname (evidence: `foundry_sdk/_core/client_init_helpers.py`)
- User token auth → Authentication: implements (evidence: `foundry_sdk/_core/user_token_auth_client.py`)
- OAuth client auth → Authentication: implements (evidence: `foundry_sdk/_core/confidential_client_auth.py`)
- Public client auth → Authentication: implements (evidence: `foundry_sdk/_core/public_client_auth.py`)
- Pipeline auth → Authentication: implements (evidence: `foundry_sdk/_core/compute_module_pipeline_auth.py`)
- Datasets → API transport: uses
- Ontology resources → API transport: uses
- Functions and queries → API transport: uses (evidence: `foundry_sdk/v2/functions/query.py`)
- SQL queries → API transport: uses (evidence: `foundry_sdk/v2/sql_queries/sql_query.py`)
- Filesystem → API transport: uses
- Administration → API transport: uses
- AI agents and models → API transport: uses
- Orchestration → API transport: uses
- Connectivity and streams → API transport: uses
- API transport → Foundry API: sends API requests
- SDK user → Datasets: creates branch
- Ontology resources → Foundry API: accesses resources
- Datasets → Shared models: uses schemas
- API transport → Error handling: raises API errors
