# happyshadowcoder/image-to-table architecture

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

- Interactive diagram: https://gitdiagram.com/happyshadowcoder/image-to-table
- Repository: https://github.com/happyshadowcoder/image-to-table

## Overview

TableLens is a Flask-based table-extraction application. A user works in the browser with an image, chooses local or cloud vision, and obtains structured table data for Excel or CSV export. The README also describes nested-header handling, one-shot extraction, and model settings. The main Python source was not excerpted, so internal runtime wiring is represented only where the README documents the workflow; implementation details remain uncertain.

Main entry points: [`app.py`](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py) (Image extraction), [`templates/index.html`](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/index.html) (Extraction interface), [`templates/dashboard.html`](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/dashboard.html) (Model settings), [`templates/docs.html`](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/docs.html) (Help pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_webapp["Flask application<br/>[app.py]"]
  node_extract_ui["Extraction interface<br/>[index.html]"]
  node_settings_ui["Model settings<br/>[dashboard.html]"]
  node_docs_ui["Help pages<br/>[docs.html]"]
end

subgraph group_processing["Table processing"]
  node_vision["Image extraction<br/>[app.py]"]
  node_one_shot["One-shot mode<br/>[app.py]"]
  node_structuring["Table structuring<br/>[app.py]"]
end

subgraph group_models["Vision providers"]
  node_local["Local Ollama<br/>[app.py]"]
  node_cloud["Cloud APIs<br/>[app.py]"]
end

subgraph group_output["Export"]
  node_xlsx["Excel export<br/>[app.py]"]
  node_csv["CSV export<br/>[app.py]"]
end

node_user(("User"))
node_browser["Browser"]
node_ollama["Ollama service"]
node_openai["OpenAI API"]
node_gemini["Gemini API"]

node_user -->|"uses"| node_browser
node_browser -->|"opens"| node_webapp
node_webapp -.->|"presents"| node_extract_ui
node_webapp -.->|"presents"| node_settings_ui
node_webapp -.->|"presents"| node_docs_ui
node_browser -->|"submits image"| node_vision
node_vision -->|"uses local model"| node_local
node_vision -->|"uses cloud model"| node_cloud
node_local -->|"calls"| node_ollama
node_cloud -->|"calls"| node_openai
node_cloud -->|"calls"| node_gemini
node_vision -->|"supports"| node_one_shot
node_vision -->|"structures tables"| node_structuring
node_structuring -->|"exports"| node_xlsx
node_structuring -->|"exports"| node_csv

click node_webapp "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_extract_ui "https://github.com/happyshadowcoder/image-to-table/blob/main/templates/index.html"
click node_settings_ui "https://github.com/happyshadowcoder/image-to-table/blob/main/templates/dashboard.html"
click node_docs_ui "https://github.com/happyshadowcoder/image-to-table/blob/main/templates/docs.html"
click node_vision "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_one_shot "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_structuring "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_local "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_cloud "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_xlsx "https://github.com/happyshadowcoder/image-to-table/blob/main/app.py"
click node_csv "https://github.com/happyshadowcoder/image-to-table/blob/main/app.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_webapp,node_extract_ui,node_settings_ui,node_docs_ui,node_user,node_browser toneBlue
class node_vision,node_one_shot,node_structuring toneAmber
class node_local,node_cloud,node_openai,node_gemini toneMint
class node_xlsx,node_csv toneRose
class node_ollama toneIndigo
```

## Components

### Web interface

- [Flask application](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`
- [Extraction interface](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/index.html): `templates/index.html`
- [Model settings](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Help pages](https://github.com/happyshadowcoder/image-to-table/blob/main/templates/docs.html): `templates/docs.html`

### Table processing

- [Image extraction](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`
- [One-shot mode](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`
- [Table structuring](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`

### Vision providers

- [Local Ollama](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`
- [Cloud APIs](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`

### Export

- [Excel export](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`
- [CSV export](https://github.com/happyshadowcoder/image-to-table/blob/main/app.py): `app.py`

### Other components

- **User**
- **Browser**
- **Ollama service**
- **OpenAI API**
- **Gemini API**

## Connections

- User → Browser: uses (evidence: `README.md`)
- Browser → Flask application: opens (evidence: `README.md`)
- Flask application → Extraction interface: presents
- Flask application → Model settings: presents
- Flask application → Help pages: presents
- Browser → Image extraction: submits image (evidence: `README.md`)
- Image extraction → Local Ollama: uses local model (evidence: `README.md`)
- Image extraction → Cloud APIs: uses cloud model (evidence: `README.md`)
- Local Ollama → Ollama service: calls (evidence: `README.md`)
- Cloud APIs → OpenAI API: calls (evidence: `README.md`)
- Cloud APIs → Gemini API: calls (evidence: `README.md`)
- Image extraction → One-shot mode: supports (evidence: `README.md`)
- Image extraction → Table structuring: structures tables (evidence: `README.md`)
- Table structuring → Excel export: exports (evidence: `README.md`)
- Table structuring → CSV export: exports (evidence: `README.md`)
