You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- render workbook-facing output in `zh-CN` or `en`
11
11
- keep storage pluggable through `ExcelStorage`
12
12
13
-
The current stable release is `2.2.8`, which continues the 2.x line with a clearer integration roadmap, stronger import-failure payload smoke verification, and more direct install-time validation of the FastAPI reference app.
13
+
The current stable release is `2.3.0`, which continues the 2.x line with a
14
+
more complete import workflow: clearer template guidance before upload,
15
+
lightweight structural preflight before execution, synchronous lifecycle
16
+
visibility during import, and remediation-oriented payloads after failures.
Copy file name to clipboardExpand all lines: README.md
+93-1Lines changed: 93 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,20 @@ This repository is also a design artifact.
20
20
It documents a series of deliberate engineering choices: `src/` layout, Pydantic v2 migration, pandas removal,
21
21
pluggable storage, `uv`-based workflows, and locale-aware workbook output.
22
22
23
-
The current stable release is `2.2.8`, which continues the ExcelAlchemy 2.x line with a clearer integration roadmap, stronger import-failure payload smoke verification, and more direct install-time validation of the FastAPI reference app.
23
+
The current stable release is `2.3.0`, which continues the ExcelAlchemy 2.x
24
+
line with a more complete import workflow: clearer template guidance before
25
+
upload, lightweight structural preflight before execution, synchronous
26
+
lifecycle visibility during import, and remediation-oriented payloads after
27
+
failures.
24
28
25
29
## At a Glance
26
30
27
31
- Build Excel templates directly from typed Pydantic schemas
32
+
- Guide users with workbook-facing input hints and examples
33
+
- Run lightweight structural preflight checks before full import
28
34
- Validate uploaded workbooks and write failures back to rows and cells
35
+
- Observe import lifecycle progress through additive callbacks
36
+
- Build remediation-oriented payloads for retry workflows
29
37
- Keep storage pluggable through `ExcelStorage`
30
38
- Render workbook-facing text in `zh-CN` or `en`
31
39
- Stay lightweight at runtime with `openpyxl` instead of pandas
@@ -91,6 +99,89 @@ and a concrete example value.
91
99
For browser downloads, prefer `template.as_bytes()` with a `Blob`, or return the bytes from your backend with
92
100
`Content-Disposition: attachment`. A top-level navigation to a long `data:` URL is less reliable in modern browsers.
93
101
102
+
## Import Workflow
103
+
104
+
ExcelAlchemy is designed to work as a product-ready import layer rather than
105
+
only a row-validation helper.
106
+
107
+
The practical workflow in the 2.x line is:
108
+
109
+
- generate a template with workbook-facing guidance
110
+
- run `preflight_import(...)` as a lightweight structural gate
111
+
- run `import_data(..., on_event=...)` for full validation and execution
112
+
- build remediation-oriented payloads if the import fails
113
+
114
+
Use `preflight_import(...)` when you want a fast answer to:
115
+
116
+
- does the configured sheet exist
117
+
- do the workbook headers match the schema
118
+
- is the workbook structurally importable
119
+
120
+
Use `import_data(...)` when you want the full workflow:
121
+
122
+
- row validation
123
+
- create / update callback execution
124
+
- result workbook rendering
125
+
- structured row and cell failure output
126
+
127
+
Short example:
128
+
129
+
```python
130
+
from pydantic import BaseModel
131
+
132
+
from excelalchemy import ExcelAlchemy, Email, FieldMeta, ImporterConfig, Number, String
133
+
from excelalchemy.results import build_frontend_remediation_payload
134
+
135
+
136
+
classEmployeeImporter(BaseModel):
137
+
full_name: String = FieldMeta(label='Full name', order=1, hint='Use the legal name')
0 commit comments