exstruct 0.1.11__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,366 @@
1
+ Metadata-Version: 2.3
2
+ Name: exstruct
3
+ Version: 0.2.1
4
+ Summary: Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines
5
+ Keywords: excel,structure,data,exstruct
6
+ Author: harumiWeb
7
+ Author-email: harumiWeb <ganaharumi@outlook.jp>
8
+ License: BSD 3-Clause License
9
+
10
+ Copyright (c) 2025, ExStruct Contributors
11
+ All rights reserved.
12
+
13
+ Redistribution and use in source and binary forms, with or without
14
+ modification, are permitted provided that the following conditions are met:
15
+
16
+ 1. Redistributions of source code must retain the above copyright notice, this
17
+ list of conditions and the following disclaimer.
18
+
19
+ 2. Redistributions in binary form must reproduce the above copyright notice,
20
+ this list of conditions and the following disclaimer in the documentation
21
+ and/or other materials provided with the distribution.
22
+
23
+ 3. Neither the name of the copyright holder nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+ Requires-Dist: numpy>=2.3.5
38
+ Requires-Dist: openpyxl>=3.1.5
39
+ Requires-Dist: pandas>=2.3.3
40
+ Requires-Dist: pydantic>=2.12.5
41
+ Requires-Dist: scipy>=1.16.3
42
+ Requires-Dist: xlwings>=0.33.16
43
+ Requires-Dist: pypdfium2>=5.1.0 ; extra == 'render'
44
+ Requires-Dist: python-toon>=0.1.3 ; extra == 'toon'
45
+ Requires-Dist: pyyaml>=6.0.3 ; extra == 'yaml'
46
+ Requires-Python: >=3.11
47
+ Project-URL: Documentation, https://harumiweb.github.io/exstruct/
48
+ Project-URL: Homepage, https://harumiweb.github.io/exstruct/
49
+ Project-URL: Issues, https://github.com/harumiWeb/exstruct/issues
50
+ Project-URL: Repository, https://github.com/harumiWeb/exstruct
51
+ Provides-Extra: render
52
+ Provides-Extra: toon
53
+ Provides-Extra: yaml
54
+ Description-Content-Type: text/markdown
55
+
56
+ # ExStruct — Excel Structured Extraction Engine
57
+
58
+ <img width="3168" height="1344" alt="Gemini_Generated_Image_nlwx0bnlwx0bnlwx" src="https://github.com/user-attachments/assets/90231682-fb42-428e-bf01-4389e8116b65" />
59
+
60
+ ExStruct reads Excel workbooks and outputs structured data (tables, shapes, charts) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
61
+
62
+ ## Features
63
+
64
+ - **Excel → Structured JSON**: cells, shapes, charts, and table candidates per sheet.
65
+ - **Output modes**: `light` (cells + table candidates only), `standard` (texted shapes + arrows, charts), `verbose` (all shapes with width/height).
66
+ - **Formats**: JSON (compact by default, `--pretty` available), YAML, TOON (optional dependencies).
67
+ - **Table detection tuning**: adjust heuristics at runtime via API.
68
+ - **CLI rendering** (Excel required): optional PDF and per-sheet PNGs.
69
+ - **Graceful fallback**: if Excel COM is unavailable, extraction falls back to cells + table candidates without crashing.
70
+
71
+ ## Installation
72
+
73
+ ```bash
74
+ pip install exstruct
75
+ ```
76
+
77
+ Optional extras:
78
+
79
+ - YAML: `pip install pyyaml`
80
+ - TOON: `pip install python-toon`
81
+ - Rendering (PDF/PNG): Excel + `pip install pypdfium2`
82
+
83
+ ## Quick Start (CLI)
84
+
85
+ ```bash
86
+ exstruct input.xlsx > output.json # compact JSON to stdout (default)
87
+ exstruct input.xlsx -o out.json --pretty # pretty JSON to a file
88
+ exstruct input.xlsx --format yaml # YAML (needs pyyaml)
89
+ exstruct input.xlsx --format toon # TOON (needs python-toon)
90
+ exstruct input.xlsx --sheets-dir sheets/ # split per sheet in chosen format
91
+ exstruct input.xlsx --mode light # cells + table candidates only
92
+ exstruct input.xlsx --pdf --image # PDF and PNGs (Excel required)
93
+ ```
94
+
95
+ ## Quick Start (Python)
96
+
97
+ ```python
98
+ from pathlib import Path
99
+ from exstruct import extract, export, set_table_detection_params
100
+
101
+ # Tune table detection (optional)
102
+ set_table_detection_params(table_score_threshold=0.3, density_min=0.04)
103
+
104
+ # Extract with modes: "light", "standard", "verbose"
105
+ wb = extract("input.xlsx", mode="standard")
106
+ export(wb, Path("out.json"), pretty=False) # compact JSON
107
+
108
+ # Model helpers: iterate, index, and serialize directly from the models
109
+ first_sheet = wb["Sheet1"] # __getitem__ access
110
+ for name, sheet in wb: # __iter__ yields (name, SheetData)
111
+ print(name, len(sheet.rows))
112
+ wb.save("out.json", pretty=True) # WorkbookData → file (by extension)
113
+ first_sheet.save("sheet.json") # SheetData → file (by extension)
114
+ print(first_sheet.to_yaml()) # YAML text (requires pyyaml)
115
+
116
+ # ExStructEngine: per-instance options for extraction/output
117
+ from exstruct import ExStructEngine, StructOptions, OutputOptions
118
+
119
+ engine = ExStructEngine(
120
+ options=StructOptions(mode="standard"),
121
+ output=OutputOptions(include_shapes=False, pretty=True),
122
+ )
123
+ wb2 = engine.extract("input.xlsx")
124
+ engine.export(wb2, Path("out_filtered.json")) # drops shapes via OutputOptions
125
+ ```
126
+
127
+ ## Table Detection Tuning
128
+
129
+ ```python
130
+ from exstruct import set_table_detection_params
131
+
132
+ set_table_detection_params(
133
+ table_score_threshold=0.35, # increase to be stricter
134
+ density_min=0.05,
135
+ coverage_min=0.2,
136
+ min_nonempty_cells=3,
137
+ )
138
+ ```
139
+
140
+ Use higher thresholds to reduce false positives; lower them if true tables are missed.
141
+
142
+ ## Output Modes
143
+
144
+ - **light**: cells + table candidates (no COM needed).
145
+ - **standard**: texted shapes + arrows, charts (COM if available), table candidates.
146
+ - **verbose**: all shapes (with width/height), charts, table candidates.
147
+
148
+ ## Error Handling / Fallbacks
149
+
150
+ - Excel COM unavailable → falls back to cells + table candidates; shapes/charts empty.
151
+ - Shape extraction failure → logs warning, still returns cells + table candidates.
152
+ - CLI prints errors to stdout/stderr and returns non-zero on failures.
153
+
154
+ ## Optional Rendering
155
+
156
+ Requires Excel and `pypdfium2`.
157
+
158
+ ```bash
159
+ exstruct input.xlsx --pdf --image --dpi 144
160
+ ```
161
+
162
+ Creates `<output>.pdf` and `<output>_images/` PNGs per sheet.
163
+
164
+ ## Benchmark: Excel Structuring Demo
165
+
166
+ To show how well exstruct can structure Excel, we parse a workbook that combines three elements on one sheet and share an AI reasoning benchmark that uses the JSON output.
167
+
168
+ - Table (sales data)
169
+ - Line chart
170
+ - Flowchart built only with shapes
171
+
172
+ (Screenshot below is the actual sample Excel sheet)
173
+ <img width="1842" height="1242" alt="スクリーンショット 2025-12-04 221252" src="https://github.com/user-attachments/assets/37ffcb3d-121e-47c1-a59f-0497337c85d9" />
174
+
175
+ ### 1. Input: Excel Sheet Overview
176
+
177
+ This sample Excel contains:
178
+
179
+ ### ① Table (Sales Data)
180
+
181
+ | Month | Product A | Product B | Product C |
182
+ | ------ | --------- | --------- | --------- |
183
+ | Jan-25 | 120 | 80 | 60 |
184
+ | Feb-25 | 135 | 90 | 64 |
185
+ | Mar-25 | 150 | 100 | 70 |
186
+ | Apr-25 | 170 | 110 | 72 |
187
+ | May-25 | 160 | 120 | 75 |
188
+ | Jun-25 | 180 | 130 | 80 |
189
+
190
+ ### ② Chart (Line Chart)
191
+
192
+ - Title: Sales Data
193
+ - Series: Product A / Product B / Product C (six months)
194
+ - Y axis: 0–200
195
+
196
+ ### ③ Flowchart built with shapes
197
+
198
+ The sheet includes this flow:
199
+
200
+ - Start / End
201
+ - Format check
202
+ - Loop (items remaining?)
203
+ - Error handling
204
+ - Yes/No decision for sending email
205
+
206
+ ### 2. Output: Structured JSON produced by exstruct (excerpt)
207
+
208
+ Below is a **shortened JSON output example** from parsing this Excel workbook.
209
+
210
+ ```json
211
+ {
212
+ "book_name": "sample.xlsx",
213
+ "sheets": {
214
+ "Sheet1": {
215
+ "rows": [
216
+ {
217
+ "r": 3,
218
+ "c": {
219
+ "1": "月",
220
+ "2": "製品A",
221
+ "3": "製品B",
222
+ "4": "製品C"
223
+ }
224
+ },
225
+ ...
226
+ ],
227
+ "shapes": [
228
+ {
229
+ "text": "開始",
230
+ "l": 148,
231
+ "t": 220,
232
+ "type": "AutoShape-FlowchartProcess"
233
+ },
234
+ {
235
+ "text": "入力データ読み込み",
236
+ "l": 132,
237
+ "t": 282,
238
+ "type": "AutoShape-FlowchartProcess"
239
+ },
240
+ {
241
+ "l": 193,
242
+ "t": 246,
243
+ "type": "AutoShape-Mixed",
244
+ "begin_arrow_style": 1,
245
+ "end_arrow_style": 2,
246
+ "direction": "N"
247
+ },
248
+ ...
249
+ ],
250
+ "charts": [
251
+ {
252
+ "name": "Chart 1",
253
+ "chart_type": "Line",
254
+ "title": "売上データ",
255
+ "y_axis_range": [
256
+ 0.0,
257
+ 200.0
258
+ ],
259
+ "series": [
260
+ {
261
+ "name": "製品A",
262
+ "name_range": "Sheet1!$C$3",
263
+ "x_range": "Sheet1!$B$4:$B$9",
264
+ "y_range": "Sheet1!$C$4:$C$9"
265
+ },
266
+ ...
267
+ ],
268
+ "l": 377,
269
+ "t": 25
270
+ }
271
+ ],
272
+ "table_candidates": [
273
+ "B3:E9"
274
+ ]
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ ### 3. How AI (Copilot / LLM) interprets the JSON
281
+
282
+ ````md
283
+ Below is the Markdown reconstruction of the Excel workbook. The table, chart, and flowchart are all represented.
284
+
285
+ ---
286
+
287
+ ## 📊 Sales Data Table
288
+
289
+ | Month | Product A | Product B | Product C |
290
+ | ---------- | --------- | --------- | --------- |
291
+ | 2025-01-01 | 120 | 80 | 60 |
292
+ | 2025-02-01 | 135 | 90 | 64 |
293
+ | 2025-03-01 | 150 | 100 | 70 |
294
+ | 2025-04-01 | 170 | 110 | 72 |
295
+ | 2025-05-01 | 160 | 120 | 75 |
296
+ | 2025-06-01 | 180 | 130 | 80 |
297
+
298
+ ---
299
+
300
+ ## 📈 Sales Data (Line Chart)
301
+
302
+ - Chart title: **売上データ (Sales Data)**
303
+ - Chart type: Line
304
+ - Y-axis range: 0 to 200
305
+ - Data series:
306
+ - Product A: 120 → 135 → 150 → 170 → 160 → 180
307
+ - Product B: 80 → 90 → 100 → 110 → 120 → 130
308
+ - Product C: 60 → 64 → 70 → 72 → 75 → 80
309
+
310
+ ---
311
+
312
+ ## 🔄 Process Flow (Mermaid Flowchart)
313
+
314
+ ```mermaid
315
+ flowchart TD
316
+ A[Start]
317
+ B[Load input data]
318
+ C{Is format valid?}
319
+ D[Show error]
320
+ E[Process one item]
321
+ F{Items remaining?}
322
+ G[Generate output]
323
+ H{Send email?}
324
+ I[Send email]
325
+ J[Finish]
326
+
327
+ A --> B
328
+ B --> C
329
+ C -- no --> D
330
+ C -- yes --> E
331
+ E --> F
332
+ F -- yes --> E
333
+ F -- no --> G
334
+ G --> H
335
+ H -- yes --> I
336
+ H -- no --> J
337
+ I --> J
338
+ ```
339
+ ````
340
+
341
+ From this we can see:
342
+
343
+ **exstruct's JSON is already in a format that AI can read and reason over directly.**
344
+
345
+ ### 4. Summary
346
+
347
+ This benchmark confirms exstruct can:
348
+
349
+ - **Parse tables, charts, and shapes (flowcharts) simultaneously**
350
+ - Convert the semantic structure of Excel into JSON
351
+ - Let AI/LLMs read that JSON directly and reconstruct the workbook contents
352
+
353
+ In short, **exstruct = “an engine that converts Excel into a format AI can understand.”**
354
+
355
+ ## Notes
356
+
357
+ - Default JSON is compact to reduce tokens; use `--pretty` or `pretty=True` when readability matters.
358
+ - Field `table_candidates` replaces `tables`; adjust downstream consumers accordingly.
359
+
360
+ ## License
361
+
362
+ BSD-3-Clause. See `LICENSE` for details.
363
+
364
+ ## Documentation
365
+
366
+ - API Reference (GitHub Pages): https://harumiweb.github.io/exstruct/
@@ -0,0 +1,311 @@
1
+ # ExStruct — Excel Structured Extraction Engine
2
+
3
+ <img width="3168" height="1344" alt="Gemini_Generated_Image_nlwx0bnlwx0bnlwx" src="https://github.com/user-attachments/assets/90231682-fb42-428e-bf01-4389e8116b65" />
4
+
5
+ ExStruct reads Excel workbooks and outputs structured data (tables, shapes, charts) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
6
+
7
+ ## Features
8
+
9
+ - **Excel → Structured JSON**: cells, shapes, charts, and table candidates per sheet.
10
+ - **Output modes**: `light` (cells + table candidates only), `standard` (texted shapes + arrows, charts), `verbose` (all shapes with width/height).
11
+ - **Formats**: JSON (compact by default, `--pretty` available), YAML, TOON (optional dependencies).
12
+ - **Table detection tuning**: adjust heuristics at runtime via API.
13
+ - **CLI rendering** (Excel required): optional PDF and per-sheet PNGs.
14
+ - **Graceful fallback**: if Excel COM is unavailable, extraction falls back to cells + table candidates without crashing.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install exstruct
20
+ ```
21
+
22
+ Optional extras:
23
+
24
+ - YAML: `pip install pyyaml`
25
+ - TOON: `pip install python-toon`
26
+ - Rendering (PDF/PNG): Excel + `pip install pypdfium2`
27
+
28
+ ## Quick Start (CLI)
29
+
30
+ ```bash
31
+ exstruct input.xlsx > output.json # compact JSON to stdout (default)
32
+ exstruct input.xlsx -o out.json --pretty # pretty JSON to a file
33
+ exstruct input.xlsx --format yaml # YAML (needs pyyaml)
34
+ exstruct input.xlsx --format toon # TOON (needs python-toon)
35
+ exstruct input.xlsx --sheets-dir sheets/ # split per sheet in chosen format
36
+ exstruct input.xlsx --mode light # cells + table candidates only
37
+ exstruct input.xlsx --pdf --image # PDF and PNGs (Excel required)
38
+ ```
39
+
40
+ ## Quick Start (Python)
41
+
42
+ ```python
43
+ from pathlib import Path
44
+ from exstruct import extract, export, set_table_detection_params
45
+
46
+ # Tune table detection (optional)
47
+ set_table_detection_params(table_score_threshold=0.3, density_min=0.04)
48
+
49
+ # Extract with modes: "light", "standard", "verbose"
50
+ wb = extract("input.xlsx", mode="standard")
51
+ export(wb, Path("out.json"), pretty=False) # compact JSON
52
+
53
+ # Model helpers: iterate, index, and serialize directly from the models
54
+ first_sheet = wb["Sheet1"] # __getitem__ access
55
+ for name, sheet in wb: # __iter__ yields (name, SheetData)
56
+ print(name, len(sheet.rows))
57
+ wb.save("out.json", pretty=True) # WorkbookData → file (by extension)
58
+ first_sheet.save("sheet.json") # SheetData → file (by extension)
59
+ print(first_sheet.to_yaml()) # YAML text (requires pyyaml)
60
+
61
+ # ExStructEngine: per-instance options for extraction/output
62
+ from exstruct import ExStructEngine, StructOptions, OutputOptions
63
+
64
+ engine = ExStructEngine(
65
+ options=StructOptions(mode="standard"),
66
+ output=OutputOptions(include_shapes=False, pretty=True),
67
+ )
68
+ wb2 = engine.extract("input.xlsx")
69
+ engine.export(wb2, Path("out_filtered.json")) # drops shapes via OutputOptions
70
+ ```
71
+
72
+ ## Table Detection Tuning
73
+
74
+ ```python
75
+ from exstruct import set_table_detection_params
76
+
77
+ set_table_detection_params(
78
+ table_score_threshold=0.35, # increase to be stricter
79
+ density_min=0.05,
80
+ coverage_min=0.2,
81
+ min_nonempty_cells=3,
82
+ )
83
+ ```
84
+
85
+ Use higher thresholds to reduce false positives; lower them if true tables are missed.
86
+
87
+ ## Output Modes
88
+
89
+ - **light**: cells + table candidates (no COM needed).
90
+ - **standard**: texted shapes + arrows, charts (COM if available), table candidates.
91
+ - **verbose**: all shapes (with width/height), charts, table candidates.
92
+
93
+ ## Error Handling / Fallbacks
94
+
95
+ - Excel COM unavailable → falls back to cells + table candidates; shapes/charts empty.
96
+ - Shape extraction failure → logs warning, still returns cells + table candidates.
97
+ - CLI prints errors to stdout/stderr and returns non-zero on failures.
98
+
99
+ ## Optional Rendering
100
+
101
+ Requires Excel and `pypdfium2`.
102
+
103
+ ```bash
104
+ exstruct input.xlsx --pdf --image --dpi 144
105
+ ```
106
+
107
+ Creates `<output>.pdf` and `<output>_images/` PNGs per sheet.
108
+
109
+ ## Benchmark: Excel Structuring Demo
110
+
111
+ To show how well exstruct can structure Excel, we parse a workbook that combines three elements on one sheet and share an AI reasoning benchmark that uses the JSON output.
112
+
113
+ - Table (sales data)
114
+ - Line chart
115
+ - Flowchart built only with shapes
116
+
117
+ (Screenshot below is the actual sample Excel sheet)
118
+ <img width="1842" height="1242" alt="スクリーンショット 2025-12-04 221252" src="https://github.com/user-attachments/assets/37ffcb3d-121e-47c1-a59f-0497337c85d9" />
119
+
120
+ ### 1. Input: Excel Sheet Overview
121
+
122
+ This sample Excel contains:
123
+
124
+ ### ① Table (Sales Data)
125
+
126
+ | Month | Product A | Product B | Product C |
127
+ | ------ | --------- | --------- | --------- |
128
+ | Jan-25 | 120 | 80 | 60 |
129
+ | Feb-25 | 135 | 90 | 64 |
130
+ | Mar-25 | 150 | 100 | 70 |
131
+ | Apr-25 | 170 | 110 | 72 |
132
+ | May-25 | 160 | 120 | 75 |
133
+ | Jun-25 | 180 | 130 | 80 |
134
+
135
+ ### ② Chart (Line Chart)
136
+
137
+ - Title: Sales Data
138
+ - Series: Product A / Product B / Product C (six months)
139
+ - Y axis: 0–200
140
+
141
+ ### ③ Flowchart built with shapes
142
+
143
+ The sheet includes this flow:
144
+
145
+ - Start / End
146
+ - Format check
147
+ - Loop (items remaining?)
148
+ - Error handling
149
+ - Yes/No decision for sending email
150
+
151
+ ### 2. Output: Structured JSON produced by exstruct (excerpt)
152
+
153
+ Below is a **shortened JSON output example** from parsing this Excel workbook.
154
+
155
+ ```json
156
+ {
157
+ "book_name": "sample.xlsx",
158
+ "sheets": {
159
+ "Sheet1": {
160
+ "rows": [
161
+ {
162
+ "r": 3,
163
+ "c": {
164
+ "1": "月",
165
+ "2": "製品A",
166
+ "3": "製品B",
167
+ "4": "製品C"
168
+ }
169
+ },
170
+ ...
171
+ ],
172
+ "shapes": [
173
+ {
174
+ "text": "開始",
175
+ "l": 148,
176
+ "t": 220,
177
+ "type": "AutoShape-FlowchartProcess"
178
+ },
179
+ {
180
+ "text": "入力データ読み込み",
181
+ "l": 132,
182
+ "t": 282,
183
+ "type": "AutoShape-FlowchartProcess"
184
+ },
185
+ {
186
+ "l": 193,
187
+ "t": 246,
188
+ "type": "AutoShape-Mixed",
189
+ "begin_arrow_style": 1,
190
+ "end_arrow_style": 2,
191
+ "direction": "N"
192
+ },
193
+ ...
194
+ ],
195
+ "charts": [
196
+ {
197
+ "name": "Chart 1",
198
+ "chart_type": "Line",
199
+ "title": "売上データ",
200
+ "y_axis_range": [
201
+ 0.0,
202
+ 200.0
203
+ ],
204
+ "series": [
205
+ {
206
+ "name": "製品A",
207
+ "name_range": "Sheet1!$C$3",
208
+ "x_range": "Sheet1!$B$4:$B$9",
209
+ "y_range": "Sheet1!$C$4:$C$9"
210
+ },
211
+ ...
212
+ ],
213
+ "l": 377,
214
+ "t": 25
215
+ }
216
+ ],
217
+ "table_candidates": [
218
+ "B3:E9"
219
+ ]
220
+ }
221
+ }
222
+ }
223
+ ```
224
+
225
+ ### 3. How AI (Copilot / LLM) interprets the JSON
226
+
227
+ ````md
228
+ Below is the Markdown reconstruction of the Excel workbook. The table, chart, and flowchart are all represented.
229
+
230
+ ---
231
+
232
+ ## 📊 Sales Data Table
233
+
234
+ | Month | Product A | Product B | Product C |
235
+ | ---------- | --------- | --------- | --------- |
236
+ | 2025-01-01 | 120 | 80 | 60 |
237
+ | 2025-02-01 | 135 | 90 | 64 |
238
+ | 2025-03-01 | 150 | 100 | 70 |
239
+ | 2025-04-01 | 170 | 110 | 72 |
240
+ | 2025-05-01 | 160 | 120 | 75 |
241
+ | 2025-06-01 | 180 | 130 | 80 |
242
+
243
+ ---
244
+
245
+ ## 📈 Sales Data (Line Chart)
246
+
247
+ - Chart title: **売上データ (Sales Data)**
248
+ - Chart type: Line
249
+ - Y-axis range: 0 to 200
250
+ - Data series:
251
+ - Product A: 120 → 135 → 150 → 170 → 160 → 180
252
+ - Product B: 80 → 90 → 100 → 110 → 120 → 130
253
+ - Product C: 60 → 64 → 70 → 72 → 75 → 80
254
+
255
+ ---
256
+
257
+ ## 🔄 Process Flow (Mermaid Flowchart)
258
+
259
+ ```mermaid
260
+ flowchart TD
261
+ A[Start]
262
+ B[Load input data]
263
+ C{Is format valid?}
264
+ D[Show error]
265
+ E[Process one item]
266
+ F{Items remaining?}
267
+ G[Generate output]
268
+ H{Send email?}
269
+ I[Send email]
270
+ J[Finish]
271
+
272
+ A --> B
273
+ B --> C
274
+ C -- no --> D
275
+ C -- yes --> E
276
+ E --> F
277
+ F -- yes --> E
278
+ F -- no --> G
279
+ G --> H
280
+ H -- yes --> I
281
+ H -- no --> J
282
+ I --> J
283
+ ```
284
+ ````
285
+
286
+ From this we can see:
287
+
288
+ **exstruct's JSON is already in a format that AI can read and reason over directly.**
289
+
290
+ ### 4. Summary
291
+
292
+ This benchmark confirms exstruct can:
293
+
294
+ - **Parse tables, charts, and shapes (flowcharts) simultaneously**
295
+ - Convert the semantic structure of Excel into JSON
296
+ - Let AI/LLMs read that JSON directly and reconstruct the workbook contents
297
+
298
+ In short, **exstruct = “an engine that converts Excel into a format AI can understand.”**
299
+
300
+ ## Notes
301
+
302
+ - Default JSON is compact to reduce tokens; use `--pretty` or `pretty=True` when readability matters.
303
+ - Field `table_candidates` replaces `tables`; adjust downstream consumers accordingly.
304
+
305
+ ## License
306
+
307
+ BSD-3-Clause. See `LICENSE` for details.
308
+
309
+ ## Documentation
310
+
311
+ - API Reference (GitHub Pages): https://harumiweb.github.io/exstruct/
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "exstruct"
3
- version = "0.1.11"
3
+ version = "0.2.1"
4
4
  description = "Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }