# rice-university-academic-affairs/laken architecture

> Architecture diagram of the GitHub repository rice-university-academic-affairs/laken, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rice-university-academic-affairs/laken
- Repository: https://github.com/rice-university-academic-affairs/laken

## Overview

Laken supports a local-to-Fabric development loop: developers read and write lakehouse tables locally or in a Fabric notebook, then package and publish Python projects to a Fabric Environment. The local path hydrates table copies into a Delta cache and tracks table metadata; the notebook path uses Spark directly. Deployment configures a project, builds a wheel, and publishes it. Core read/write and publish behavior is visible in the excerpts; some CLI orchestration and project-building details are documented but not excerpted.

Main entry points: [`src/laken/local_lakehouse.py`](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/local_lakehouse.py) (Local lakehouse), [`src/laken/fabric_lakehouse.py`](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/fabric_lakehouse.py) (Fabric lakehouse), [`src/laken/cli.py`](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/cli.py) (CLI commands), [`src/laken/lakehouse.py`](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/lakehouse.py) (Lakehouse facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Lakehouse API"]
  node_lakehouse["Lakehouse facade<br/>[lakehouse.py]"]
  node_local["Local lakehouse<br/>[local_lakehouse.py]"]
  node_fabric_lakehouse["Fabric lakehouse"]
end

subgraph group_tables["Table access"]
  node_metadata[("Table metadata<br/>[workspace.py]")]
  node_delta_cache[("Local Delta cache<br/>[local_lakehouse.py]")]
  node_fetcher["OneLake fetcher<br/>[onelake_fetcher.py]"]
end

subgraph group_deploy["Deployment"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_deploy_config["Deploy configuration<br/>[config.py]"]
  node_project["Project validation<br/>[project.py]"]
  node_wheel["Wheel builder<br/>[build.py]"]
  node_publisher["Fabric publisher<br/>[fabric_client.py]"]
end

subgraph group_shared["Shared runtime"]
  node_table_names["Table naming<br/>[table_names.py]"]
  node_frames["Frame conversion<br/>[frames.py]"]
  node_spark["Spark runtime<br/>[spark_runtime.py]"]
  node_environment["Environment loading<br/>[_env.py]"]
end

node_developer(("Developer"))
node_notebook(("Fabric notebook"))
node_fabric{{"Microsoft Fabric"}}
node_fabric_environment{{"Fabric Environment"}}

node_developer -->|"uses"| node_lakehouse
node_notebook -->|"uses"| node_lakehouse
node_lakehouse -->|"loads"| node_environment
node_lakehouse -->|"selects locally"| node_local
node_lakehouse -->|"selects in notebook"| node_fabric_lakehouse
node_local -->|"reads and updates"| node_metadata
node_local -->|"reads and writes"| node_delta_cache
node_local -->|"fetches missing tables"| node_fetcher
node_fetcher -->|"reads OneLake"| node_fabric
node_local -->|"resolves names"| node_table_names
node_fabric_lakehouse -->|"resolves names"| node_table_names
node_local -->|"converts frames"| node_frames
node_fabric_lakehouse -->|"converts frames"| node_frames
node_frames -->|"uses session"| node_spark
node_fabric_lakehouse -->|"gets session"| node_spark
node_fabric_lakehouse -->|"reads and writes tables"| node_fabric
node_developer -->|"runs deploy or refresh"| node_cli
node_cli -.->|"loads configuration"| node_deploy_config
node_cli -.->|"validates project"| node_project
node_cli -->|"builds package"| node_wheel
node_cli -->|"publishes wheel"| node_publisher
node_publisher -->|"uses configuration"| node_deploy_config
node_publisher -->|"uploads and publishes"| node_fabric_environment
node_fabric_environment -->|"makes package available"| node_notebook

click node_cli "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/cli.py"
click node_lakehouse "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/lakehouse.py"
click node_local "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/local_lakehouse.py"
click node_fabric_lakehouse "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/fabric_lakehouse.py"
click node_metadata "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/workspace.py"
click node_delta_cache "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/local_lakehouse.py"
click node_fetcher "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/onelake_fetcher.py"
click node_table_names "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/table_names.py"
click node_frames "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/frames.py"
click node_spark "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/spark_runtime.py"
click node_environment "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/_env.py"
click node_deploy_config "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/config.py"
click node_project "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/project.py"
click node_wheel "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/build.py"
click node_publisher "https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/fabric_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_lakehouse,node_local,node_fabric_lakehouse toneBlue
class node_metadata,node_delta_cache,node_fetcher toneAmber
class node_cli,node_deploy_config,node_project,node_wheel,node_publisher toneMint
class node_table_names,node_frames,node_spark,node_environment toneRose
class node_developer,node_notebook,node_fabric,node_fabric_environment toneIndigo
```

## Components

### Lakehouse API

- [Lakehouse facade](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/lakehouse.py): `src/laken/lakehouse.py`
- [Local lakehouse](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/local_lakehouse.py): `src/laken/local_lakehouse.py`
- [Fabric lakehouse](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/fabric_lakehouse.py): `src/laken/fabric_lakehouse.py`

### Table access

- [Table metadata](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/workspace.py): `src/laken/workspace.py`
- [Local Delta cache](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/local_lakehouse.py): `src/laken/local_lakehouse.py`
- [OneLake fetcher](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/onelake_fetcher.py): `src/laken/onelake_fetcher.py`

### Deployment

- [CLI commands](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/cli.py): `src/laken/cli.py`
- [Deploy configuration](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/config.py): `src/laken/deploy/config.py`
- [Project validation](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/project.py): `src/laken/deploy/project.py`
- [Wheel builder](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/build.py): `src/laken/deploy/build.py`
- [Fabric publisher](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/deploy/fabric_client.py): `src/laken/deploy/fabric_client.py`

### Shared runtime

- [Table naming](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/table_names.py): `src/laken/table_names.py`
- [Frame conversion](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/frames.py): `src/laken/frames.py`
- [Spark runtime](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/spark_runtime.py): `src/laken/spark_runtime.py`
- [Environment loading](https://github.com/rice-university-academic-affairs/laken/blob/main/src/laken/_env.py): `src/laken/_env.py`

### Other components

- **Developer**
- **Fabric notebook**
- **Microsoft Fabric**
- **Fabric Environment**

## Connections

- Developer → Lakehouse facade: uses (evidence: `README.md`)
- Fabric notebook → Lakehouse facade: uses (evidence: `README.md`)
- Lakehouse facade → Environment loading: loads (evidence: `src/laken/lakehouse.py`)
- Lakehouse facade → Local lakehouse: selects locally (evidence: `src/laken/lakehouse.py`)
- Lakehouse facade → Fabric lakehouse: selects in notebook (evidence: `src/laken/lakehouse.py`)
- Local lakehouse → Table metadata: reads and updates (evidence: `src/laken/local_lakehouse.py`)
- Local lakehouse → Local Delta cache: reads and writes (evidence: `src/laken/local_lakehouse.py`)
- Local lakehouse → OneLake fetcher: fetches missing tables (evidence: `src/laken/local_lakehouse.py`)
- OneLake fetcher → Microsoft Fabric: reads OneLake (evidence: `README.md`)
- Local lakehouse → Table naming: resolves names (evidence: `src/laken/local_lakehouse.py`)
- Fabric lakehouse → Table naming: resolves names (evidence: `src/laken/fabric_lakehouse.py`)
- Local lakehouse → Frame conversion: converts frames (evidence: `src/laken/local_lakehouse.py`)
- Fabric lakehouse → Frame conversion: converts frames (evidence: `src/laken/fabric_lakehouse.py`)
- Frame conversion → Spark runtime: uses session (evidence: `src/laken/frames.py`)
- Fabric lakehouse → Spark runtime: gets session (evidence: `src/laken/fabric_lakehouse.py`)
- Fabric lakehouse → Microsoft Fabric: reads and writes tables (evidence: `README.md`)
- Developer → CLI commands: runs deploy or refresh (evidence: `README.md`)
- CLI commands → Deploy configuration: loads configuration (evidence: `src/laken/cli.py`)
- CLI commands → Project validation: validates project (evidence: `src/laken/cli.py`)
- CLI commands → Wheel builder: builds package (evidence: `README.md`)
- CLI commands → Fabric publisher: publishes wheel (evidence: `README.md`)
- Fabric publisher → Deploy configuration: uses configuration (evidence: `src/laken/deploy/fabric_client.py`)
- Fabric publisher → Fabric Environment: uploads and publishes (evidence: `src/laken/deploy/fabric_client.py`)
- Fabric Environment → Fabric notebook: makes package available (evidence: `README.md`)
