Skip to content

Commit 68feb8b

Browse files
committed
feat(v2.4): add import platform architecture docs
1 parent dd2e665 commit 68feb8b

13 files changed

Lines changed: 1926 additions & 15 deletions

README-pypi.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ more complete import workflow: clearer template guidance before upload,
1515
lightweight structural preflight before execution, synchronous lifecycle
1616
visibility during import, and remediation-oriented payloads after failures.
1717

18-
[GitHub Repository](https://github.com/RayCarterLab/ExcelAlchemy) · [Full README](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/README.md) · [Getting Started](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/getting-started.md) · [Integration Roadmap](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/integration-roadmap.md) · [Result Objects](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/result-objects.md) · [API Response Cookbook](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/api-response-cookbook.md) · [Examples Showcase](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/examples-showcase.md) · [Architecture](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/architecture.md) · [Migration Notes](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/MIGRATIONS.md)
18+
At the top level, that import workflow is:
19+
20+
- template authoring
21+
- preflight gate
22+
- import runtime
23+
- result intelligence
24+
- artifact and delivery
25+
26+
[GitHub Repository](https://github.com/RayCarterLab/ExcelAlchemy) · [Full README](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/README.md) · [Getting Started](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/getting-started.md) · [Integration Roadmap](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/integration-roadmap.md) · [Platform Architecture](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/platform-architecture.md) · [Runtime Model](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/runtime-model.md) · [Integration Blueprints](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/integration-blueprints.md) · [Result Objects](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/result-objects.md) · [API Response Cookbook](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/api-response-cookbook.md) · [Examples Showcase](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/examples-showcase.md) · [Architecture](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/architecture.md) · [Migration Notes](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/MIGRATIONS.md)
1927

2028
## Screenshots
2129

@@ -166,6 +174,9 @@ for configured selection fields.
166174
## Learn More
167175

168176
- [Full project README](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/README.md)
177+
- [Platform architecture](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/platform-architecture.md)
178+
- [Runtime model](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/runtime-model.md)
179+
- [Integration blueprints](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/integration-blueprints.md)
169180
- [Architecture notes](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/architecture.md)
170181
- [Locale policy](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/docs/locale.md)
171182
- [Migration notes](https://github.com/RayCarterLab/ExcelAlchemy/blob/main/MIGRATIONS.md)

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Lint](https://img.shields.io/badge/lint-ruff-D7FF64)
77
![Typing](https://img.shields.io/badge/typing-pyright-2C6BED)
88

9-
[中文 README](README_cn.md) · [About](ABOUT.md) · [Getting Started](docs/getting-started.md) · [Integration Roadmap](docs/integration-roadmap.md) · [Result Objects](docs/result-objects.md) · [API Response Cookbook](docs/api-response-cookbook.md) · [Architecture](docs/architecture.md) · [Examples Showcase](docs/examples-showcase.md) · [Public API](docs/public-api.md) · [Locale Policy](docs/locale.md) · [Limitations](docs/limitations.md) · [Performance](docs/performance.md) · [Changelog](CHANGELOG.md) · [Migration Notes](MIGRATIONS.md)
9+
[中文 README](README_cn.md) · [About](ABOUT.md) · [Getting Started](docs/getting-started.md) · [Integration Roadmap](docs/integration-roadmap.md) · [Platform Architecture](docs/platform-architecture.md) · [Runtime Model](docs/runtime-model.md) · [Integration Blueprints](docs/integration-blueprints.md) · [Result Objects](docs/result-objects.md) · [API Response Cookbook](docs/api-response-cookbook.md) · [Architecture](docs/architecture.md) · [Examples Showcase](docs/examples-showcase.md) · [Public API](docs/public-api.md) · [Locale Policy](docs/locale.md) · [Limitations](docs/limitations.md) · [Performance](docs/performance.md) · [Changelog](CHANGELOG.md) · [Migration Notes](MIGRATIONS.md)
1010

1111
Repository guides: [AGENTS.md](AGENTS.md) · [Repository Map](docs/repo-map.md) · [Domain Model](docs/domain-model.md) · [Invariants](docs/invariants.md) · [Package Guide](src/excelalchemy/README.md) · [Test Guide](tests/README.md) · [Examples Guide](examples/README.md)
1212

@@ -26,6 +26,12 @@ upload, lightweight structural preflight before execution, synchronous
2626
lifecycle visibility during import, and remediation-oriented payloads after
2727
failures.
2828

29+
For the platform-layer architecture of that workflow, see:
30+
31+
- [`docs/platform-architecture.md`](docs/platform-architecture.md)
32+
- [`docs/runtime-model.md`](docs/runtime-model.md)
33+
- [`docs/integration-blueprints.md`](docs/integration-blueprints.md)
34+
2935
## At a Glance
3036

3137
- Build Excel templates directly from typed Pydantic schemas
@@ -104,12 +110,28 @@ For browser downloads, prefer `template.as_bytes()` with a `Blob`, or return the
104110
ExcelAlchemy is designed to work as a product-ready import layer rather than
105111
only a row-validation helper.
106112

107-
The practical workflow in the 2.x line is:
113+
The top-level import workflow in the 2.x line is:
114+
115+
- template authoring
116+
- preflight gate
117+
- import runtime
118+
- result intelligence
119+
- artifact and delivery
120+
121+
In practical terms, that usually means:
108122

109123
- generate a template with workbook-facing guidance
110124
- run `preflight_import(...)` as a lightweight structural gate
111125
- run `import_data(..., on_event=...)` for full validation and execution
126+
- inspect `ImportResult`, `CellErrorMap`, and `RowIssueMap`
112127
- build remediation-oriented payloads if the import fails
128+
- deliver template or result workbook artifacts through the configured storage seam
129+
130+
For the platform view and runtime sequence behind this workflow, see:
131+
132+
- [`docs/platform-architecture.md`](docs/platform-architecture.md)
133+
- [`docs/runtime-model.md`](docs/runtime-model.md)
134+
- [`docs/integration-blueprints.md`](docs/integration-blueprints.md)
113135

114136
Use `preflight_import(...)` when you want a fast answer to:
115137

@@ -178,9 +200,10 @@ else:
178200

179201
This keeps one clear separation:
180202

181-
- template and preflight help before execution
182-
- import handles real validation and persistence
183-
- remediation helps API and frontend retry flows after failure
203+
- template authoring and preflight help before execution
204+
- import runtime handles real validation and persistence
205+
- result intelligence helps API and frontend retry flows after failure
206+
- artifact and delivery expose files and URLs after the run
184207

185208
## When To Use / When Not To Use / Limitations & Gotchas
186209

@@ -284,6 +307,10 @@ flowchart TD
284307
```
285308

286309
See the full breakdown in [docs/architecture.md](docs/architecture.md).
310+
For the integration-oriented platform view layered above those components, see
311+
[docs/platform-architecture.md](docs/platform-architecture.md),
312+
[docs/runtime-model.md](docs/runtime-model.md), and
313+
[docs/integration-blueprints.md](docs/integration-blueprints.md).
287314

288315
## Workflow
289316

@@ -590,6 +617,9 @@ More detail is documented in [ABOUT.md](ABOUT.md).
590617
- [README.md](README.md): product + design overview
591618
- [README_cn.md](README_cn.md): Chinese usage-oriented guide
592619
- [ABOUT.md](ABOUT.md): engineering rationale and evolution notes
620+
- [docs/platform-architecture.md](docs/platform-architecture.md): import platform capability model
621+
- [docs/runtime-model.md](docs/runtime-model.md): runtime sequence across the import workflow
622+
- [docs/integration-blueprints.md](docs/integration-blueprints.md): backend/frontend integration patterns
593623
- [docs/architecture.md](docs/architecture.md): component map and boundaries
594624
- [docs/limitations.md](docs/limitations.md): practical fit, limitations, and gotchas
595625
- [docs/performance.md](docs/performance.md): operational guidance for large files, memory, and backend guardrails

README_cn.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# ExcelAlchemy
22

3-
[English README](./README.md) · [项目说明](./ABOUT.md) · [快速开始](./docs/getting-started.md) · [接入路线图](./docs/integration-roadmap.md) · [结果对象](./docs/result-objects.md) · [架构文档](./docs/architecture.md) · [Locale Policy](./docs/locale.md) · [Changelog](./CHANGELOG.md) · [迁移说明](./MIGRATIONS.md)
3+
[English README](./README.md) · [项目说明](./ABOUT.md) · [快速开始](./docs/getting-started.md) · [接入路线图](./docs/integration-roadmap.md) · [平台架构](./docs/platform-architecture.md) · [运行时模型](./docs/runtime-model.md) · [集成蓝图](./docs/integration-blueprints.md) · [结果对象](./docs/result-objects.md) · [架构文档](./docs/architecture.md) · [Locale Policy](./docs/locale.md) · [Changelog](./CHANGELOG.md) · [迁移说明](./MIGRATIONS.md)
44

55
ExcelAlchemy 是一个面向 Excel 导入导出的 schema-first Python 库。
66
它的核心思路不是“读写表格文件”,而是“把 Excel 当成一种带约束的业务契约”。
77

8-
当前稳定发布版本是 `2.2.8`,它在稳定的 ExcelAlchemy 2.x 线上继续加强了接入路线图、失败导入 API 载荷的 smoke 校验,以及对 FastAPI 参考应用的安装后真实可用验证。
8+
当前稳定发布版本是 `2.3.0`。在稳定的 ExcelAlchemy 2.x 线上,它进一步补齐了更完整的导入工作流:
9+
10+
- 上传前更清晰的模板引导
11+
- 执行前更轻量的结构化 preflight gate
12+
- 导入过程中的同步 lifecycle visibility
13+
- 导入失败后的 remediation-oriented payload
14+
15+
从平台层视角看,这条导入链路可以概括为:
16+
17+
- 模板编排
18+
- preflight gate
19+
- 导入运行时
20+
- 结果智能
21+
- 制品与交付
922

1023
你用 Pydantic 模型定义结构,用 `FieldMeta` 定义 Excel 元数据,用显式的导入/导出流程去完成模板生成、数据校验、错误回写和后端集成。
1124

@@ -90,6 +103,12 @@ flowchart LR
90103
H --> I
91104
```
92105

106+
如果你想先看平台层文档,而不是内部组件图,可以继续看:
107+
108+
- [`docs/platform-architecture.md`](./docs/platform-architecture.md)
109+
- [`docs/runtime-model.md`](./docs/runtime-model.md)
110+
- [`docs/integration-blueprints.md`](./docs/integration-blueprints.md)
111+
93112
## 安装
94113

95114
```bash
@@ -359,6 +378,9 @@ Minio 只是一个默认实现,真正稳定的接口应该是 `ExcelStorage`
359378
- [README.md](./README.md): 英文首页,偏作品集表达
360379
- [README_cn.md](./README_cn.md): 中文说明页,偏使用和理解
361380
- [ABOUT.md](./ABOUT.md): 设计原则、迁移记录、架构取舍
381+
- [docs/platform-architecture.md](./docs/platform-architecture.md): 导入平台层能力模型
382+
- [docs/runtime-model.md](./docs/runtime-model.md): 导入工作流的运行时顺序
383+
- [docs/integration-blueprints.md](./docs/integration-blueprints.md): 后端 / 前端接入蓝图
362384
- [docs/architecture.md](./docs/architecture.md): 组件边界与扩展点
363385

364386
## 开发

docs/architecture.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Architecture
22

3+
This page is the internal component view of the repository.
4+
If you want the integration-oriented platform view introduced for the v2.4
5+
documentation slice, see [`docs/platform-architecture.md`](platform-architecture.md).
6+
If you want the runtime sequence on top of that platform view, see
7+
[`docs/runtime-model.md`](runtime-model.md).
8+
39
## Component Map
410

511
```mermaid

docs/getting-started.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This page is the fastest way to get productive with ExcelAlchemy.
44

55
If you want screenshots and fixed workflow outputs first, see
66
[`docs/examples-showcase.md`](examples-showcase.md).
7+
If you want the platform-layer architecture of the import workflow, see
8+
[`docs/platform-architecture.md`](platform-architecture.md),
9+
[`docs/runtime-model.md`](runtime-model.md),
10+
and
11+
[`docs/integration-blueprints.md`](integration-blueprints.md).
712
If you want the full public surface and compatibility boundaries, see
813
[`docs/public-api.md`](public-api.md).
914
If you want to understand the result objects and how to surface them through an
@@ -100,6 +105,14 @@ only adds a more helpful header comment in the generated template, for example:
100105

101106
## 4. Pick The Workflow You Need
102107

108+
Top-level import workflow:
109+
110+
1. template authoring
111+
2. preflight gate
112+
3. import runtime
113+
4. result intelligence
114+
5. artifact and delivery
115+
103116
Import-only create flow:
104117

105118
```python

docs/integration-blueprints.md

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Integration Blueprints
2+
3+
This page shows practical integration blueprints for the v2.4 import platform
4+
layer.
5+
These are not new product surfaces.
6+
They are recommended ways to compose the current 2.x capabilities.
7+
8+
If you want the platform capability map, see
9+
[`docs/platform-architecture.md`](platform-architecture.md).
10+
If you want the runtime sequence view, see
11+
[`docs/runtime-model.md`](runtime-model.md).
12+
If you want detailed result payload shapes, see
13+
[`docs/result-objects.md`](result-objects.md) and
14+
[`docs/api-response-cookbook.md`](api-response-cookbook.md).
15+
16+
## Blueprint 1: Backend Worker Import Flow
17+
18+
Use this blueprint when your application already has a worker, queue, or job
19+
runner and you want ExcelAlchemy to remain the import engine inside that worker.
20+
21+
This is an application-level worker blueprint.
22+
It is not a claim that ExcelAlchemy ships a worker framework.
23+
24+
### Recommended shape
25+
26+
```mermaid
27+
flowchart LR
28+
U[Spreadsheet User] --> API[Upload API]
29+
API --> PF[Preflight Gate]
30+
PF -->|valid| Q[App Queue / Worker Trigger]
31+
PF -->|invalid| PFR[Preflight Response]
32+
33+
Q --> W[Backend Worker]
34+
W --> EA[ExcelAlchemy import_data(..., on_event=...)]
35+
EA --> RES[ImportResult + Issue Maps]
36+
EA --> OUT[Result Workbook Upload]
37+
RES --> APIRES[API Status Store / Polling Endpoint]
38+
OUT --> APIRES
39+
```
40+
41+
### Why this fits the current platform
42+
43+
- preflight stays a lightweight synchronous gate
44+
- the worker owns application scheduling and retries
45+
- `import_data(..., on_event=...)` remains the real runtime entry point
46+
- lifecycle events can update application job status inline
47+
- result intelligence remains post-import and machine-readable
48+
49+
### Recommended responsibilities
50+
51+
Upload API:
52+
53+
- accept the workbook reference
54+
- run `preflight_import(...)`
55+
- reject obvious structural failures early
56+
- enqueue only structurally importable workbooks
57+
58+
Backend worker:
59+
60+
- call `import_data(..., on_event=...)`
61+
- update job status using lifecycle events
62+
- persist `ImportResult`
63+
- persist row/cell issue payloads when needed
64+
- expose result workbook URL when one is produced
65+
66+
Application status endpoint:
67+
68+
- return job state
69+
- return final result payloads
70+
- optionally expose remediation payloads for UI consumers
71+
72+
### Important boundaries
73+
74+
- the queue, worker, retry policy, and job persistence belong to the
75+
application
76+
- ExcelAlchemy remains synchronous inside the worker execution
77+
- do not describe this as an ExcelAlchemy job subsystem
78+
79+
## Blueprint 2: Frontend Remediation Flow
80+
81+
Use this blueprint when a frontend needs both high-level outcome information and
82+
compact retry guidance after a failed import.
83+
84+
```mermaid
85+
flowchart TD
86+
U[Spreadsheet User] --> FE[Frontend]
87+
FE --> API[Backend API]
88+
API --> PF[preflight_import(...)]
89+
90+
PF -->|invalid| PRE[ImportPreflightResult payload]
91+
PF -->|valid| RUN[import_data(...)]
92+
93+
RUN --> R[ImportResult]
94+
RUN --> C[CellErrorMap]
95+
RUN --> RI[RowIssueMap]
96+
RUN --> RP[build_frontend_remediation_payload(...)]
97+
RUN --> URL[result workbook URL]
98+
99+
PRE --> FE
100+
R --> FE
101+
C --> FE
102+
RI --> FE
103+
RP --> FE
104+
URL --> FE
105+
```
106+
107+
### Recommended frontend use
108+
109+
Preflight response:
110+
111+
- decide whether the workbook is structurally importable
112+
- show blocking sheet/header problems before full execution
113+
114+
Result response:
115+
116+
- use `ImportResult` for high-level outcome and counts
117+
- use `CellErrorMap` for precise field/cell UI highlighting
118+
- use `RowIssueMap` for list/table summaries
119+
- use the remediation payload for concise retry guidance
120+
- use the result workbook URL when the user should download the annotated file
121+
122+
### Recommended response layering
123+
124+
- `preflight`
125+
- structural gate result only
126+
- `result`
127+
- overall import outcome
128+
- `cell_errors`
129+
- precise workbook-coordinate issues
130+
- `row_errors`
131+
- grouped row summaries
132+
- `remediation`
133+
- optional condensed retry guidance
134+
135+
### Important boundaries
136+
137+
- remediation payloads are additive and opt-in
138+
- they do not replace the stable result payloads
139+
- they should stay conservative and avoid overstating automatic fix guidance
140+
141+
## Blueprint 3: Artifact Delivery Flow
142+
143+
Use this blueprint when delivery of the template artifact and result workbook is
144+
part of the integration design.
145+
146+
```mermaid
147+
flowchart LR
148+
A[Application] --> T[Template Artifact Request]
149+
T --> EA[ExcelAlchemy]
150+
EA --> TA[ExcelArtifact]
151+
TA --> DL[Browser Download or API Response]
152+
153+
A --> I[Import Runtime]
154+
I --> RW[Rendered Result Workbook]
155+
RW --> ST[ExcelStorage Upload]
156+
ST --> URL[Result Workbook URL]
157+
URL --> API[API Response or Worker Status]
158+
```
159+
160+
### What this highlights
161+
162+
- template authoring and result delivery share rendering primitives
163+
- artifact delivery is a platform stage even though it depends on earlier
164+
stages
165+
- storage remains a seam rather than a mandated backend
166+
167+
## Choosing The Right Blueprint
168+
169+
- use the backend worker blueprint when your application already has queued or
170+
long-running import orchestration
171+
- use the frontend remediation blueprint when the UI needs compact retry
172+
guidance after validation failures
173+
- use the artifact delivery blueprint when file delivery semantics are a first
174+
class part of the integration
175+
176+
In all three cases, keep the same platform order:
177+
178+
1. template authoring
179+
2. preflight gate
180+
3. import runtime
181+
4. result intelligence
182+
5. artifact and delivery
183+
184+
## Recommended Reading
185+
186+
- [`docs/platform-architecture.md`](platform-architecture.md)
187+
- [`docs/runtime-model.md`](runtime-model.md)
188+
- [`docs/result-objects.md`](result-objects.md)
189+
- [`docs/api-response-cookbook.md`](api-response-cookbook.md)

0 commit comments

Comments
 (0)