exstruct 0.3.0__tar.gz → 0.3.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.
- {exstruct-0.3.0 → exstruct-0.3.1}/PKG-INFO +26 -5
- {exstruct-0.3.0 → exstruct-0.3.1}/README.md +25 -4
- {exstruct-0.3.0 → exstruct-0.3.1}/pyproject.toml +133 -128
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/backends/__init__.py +7 -7
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/backends/base.py +38 -38
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/backends/com_backend.py +226 -226
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/backends/openpyxl_backend.py +179 -179
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/charts.py +243 -241
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/integrate.py +52 -52
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/logging_utils.py +16 -16
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/modeling.py +83 -74
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/pipeline.py +696 -696
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/ranges.py +48 -48
- exstruct-0.3.1/src/exstruct/core/shapes.py +521 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/workbook.py +114 -114
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/errors.py +46 -46
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/io/__init__.py +58 -6
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/io/serialize.py +112 -112
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/models/__init__.py +34 -5
- exstruct-0.3.0/src/exstruct/core/shapes.py +0 -275
- {exstruct-0.3.0 → exstruct-0.3.1}/LICENSE +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/__init__.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/cli/availability.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/cli/main.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/__init__.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/core/cells.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/engine.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/models/maps.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/models/types.py +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/py.typed +0 -0
- {exstruct-0.3.0 → exstruct-0.3.1}/src/exstruct/render/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: exstruct
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines
|
|
5
5
|
Keywords: excel,structure,data,exstruct
|
|
6
6
|
Author: harumiWeb
|
|
@@ -55,18 +55,18 @@ Description-Content-Type: text/markdown
|
|
|
55
55
|
|
|
56
56
|
# ExStruct — Excel Structured Extraction Engine
|
|
57
57
|
|
|
58
|
-
[](https://pypi.org/project/exstruct/) [](https://pepy.tech/projects/exstruct)  [](https://github.com/harumiWeb/exstruct/actions/workflows/pytest.yml) [](https://app.codacy.com/gh/harumiWeb/exstruct/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
58
|
+
[](https://pypi.org/project/exstruct/) [](https://pepy.tech/projects/exstruct)  [](https://github.com/harumiWeb/exstruct/actions/workflows/pytest.yml) [](https://app.codacy.com/gh/harumiWeb/exstruct/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [](https://codecov.io/gh/harumiWeb/exstruct)
|
|
59
59
|
|
|
60
60
|

|
|
61
61
|
|
|
62
|
-
ExStruct reads Excel workbooks and outputs structured data (cells, table candidates, shapes, charts, print areas/views, auto page-break areas, hyperlinks) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates + print areas), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
|
|
62
|
+
ExStruct reads Excel workbooks and outputs structured data (cells, table candidates, shapes, charts, smartart, print areas/views, auto page-break areas, hyperlinks) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates + print areas), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
|
|
63
63
|
|
|
64
64
|
[日本版 README](README.ja.md)
|
|
65
65
|
|
|
66
66
|
## Features
|
|
67
67
|
|
|
68
|
-
- **Excel → Structured JSON**: cells, shapes, charts, table candidates, print areas/views, and auto page-break areas per sheet.
|
|
69
|
-
- **Output modes**: `light` (cells + table candidates + print areas; no COM, shapes/charts empty), `standard` (texted shapes + arrows, charts, print areas), `verbose` (all shapes with width/height, charts with size, print areas). Verbose also emits cell hyperlinks and `colors_map`. Size output is flag-controlled.
|
|
68
|
+
- **Excel → Structured JSON**: cells, shapes, charts, smartart, table candidates, print areas/views, and auto page-break areas per sheet.
|
|
69
|
+
- **Output modes**: `light` (cells + table candidates + print areas; no COM, shapes/charts empty), `standard` (texted shapes + arrows, charts, smartart, print areas), `verbose` (all shapes with width/height, charts with size, print areas). Verbose also emits cell hyperlinks and `colors_map`. Size output is flag-controlled.
|
|
70
70
|
- **Auto page-break export (COM only)**: capture Excel-computed auto page breaks and write per-area JSON/YAML/TOON when requested (CLI option appears only when COM is available).
|
|
71
71
|
- **Formats**: JSON (compact by default, `--pretty` available), YAML, TOON (optional dependencies).
|
|
72
72
|
- **Table detection tuning**: adjust heuristics at runtime via API.
|
|
@@ -435,6 +435,27 @@ This project is suitable for teams that:
|
|
|
435
435
|
- Use CLI `--auto-page-breaks-dir` (COM only), `DestinationOptions.auto_page_breaks_dir` (preferred), or `export_auto_page_breaks(...)` to write per-auto-page-break files; the API raises `ValueError` if no auto page breaks exist.
|
|
436
436
|
- `PrintAreaView` includes rows and table candidates inside the area, plus shapes/charts that overlap the area (size-less shapes are treated as points). `normalize=True` rebases row/col indices to the area origin.
|
|
437
437
|
|
|
438
|
+
## Architecture
|
|
439
|
+
|
|
440
|
+
ExStruct uses a pipeline-based architecture that separates
|
|
441
|
+
extraction strategy (Backend) from orchestration (Pipeline)
|
|
442
|
+
and semantic modeling.
|
|
443
|
+
|
|
444
|
+
→ See: [docs/architecture/pipeline.md](docs/architecture/pipeline.md)
|
|
445
|
+
|
|
446
|
+
## Contributing
|
|
447
|
+
|
|
448
|
+
If you plan to extend ExStruct internals,
|
|
449
|
+
please read the contributor architecture guide.
|
|
450
|
+
|
|
451
|
+
→ [docs/contributors/architecture.md](docs/contributors/architecture.md)
|
|
452
|
+
|
|
453
|
+
## Note on coverage
|
|
454
|
+
|
|
455
|
+
The cell-structure inference logic (cells.py) relies on heuristic rules
|
|
456
|
+
and Excel-specific behaviors. Full coverage is intentionally not pursued,
|
|
457
|
+
as exhaustive testing would not reflect real-world reliability.
|
|
458
|
+
|
|
438
459
|
## License
|
|
439
460
|
|
|
440
461
|
BSD-3-Clause. See `LICENSE` for details.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# ExStruct — Excel Structured Extraction Engine
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/exstruct/) [](https://pepy.tech/projects/exstruct)  [](https://github.com/harumiWeb/exstruct/actions/workflows/pytest.yml) [](https://app.codacy.com/gh/harumiWeb/exstruct/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
|
3
|
+
[](https://pypi.org/project/exstruct/) [](https://pepy.tech/projects/exstruct)  [](https://github.com/harumiWeb/exstruct/actions/workflows/pytest.yml) [](https://app.codacy.com/gh/harumiWeb/exstruct/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [](https://codecov.io/gh/harumiWeb/exstruct)
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
ExStruct reads Excel workbooks and outputs structured data (cells, table candidates, shapes, charts, print areas/views, auto page-break areas, hyperlinks) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates + print areas), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
|
|
7
|
+
ExStruct reads Excel workbooks and outputs structured data (cells, table candidates, shapes, charts, smartart, print areas/views, auto page-break areas, hyperlinks) as JSON by default, with optional YAML/TOON formats. It targets both COM/Excel environments (rich extraction) and non-COM environments (cells + table candidates + print areas), with tunable detection heuristics and multiple output modes to fit LLM/RAG pipelines.
|
|
8
8
|
|
|
9
9
|
[日本版 README](README.ja.md)
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **Excel → Structured JSON**: cells, shapes, charts, table candidates, print areas/views, and auto page-break areas per sheet.
|
|
14
|
-
- **Output modes**: `light` (cells + table candidates + print areas; no COM, shapes/charts empty), `standard` (texted shapes + arrows, charts, print areas), `verbose` (all shapes with width/height, charts with size, print areas). Verbose also emits cell hyperlinks and `colors_map`. Size output is flag-controlled.
|
|
13
|
+
- **Excel → Structured JSON**: cells, shapes, charts, smartart, table candidates, print areas/views, and auto page-break areas per sheet.
|
|
14
|
+
- **Output modes**: `light` (cells + table candidates + print areas; no COM, shapes/charts empty), `standard` (texted shapes + arrows, charts, smartart, print areas), `verbose` (all shapes with width/height, charts with size, print areas). Verbose also emits cell hyperlinks and `colors_map`. Size output is flag-controlled.
|
|
15
15
|
- **Auto page-break export (COM only)**: capture Excel-computed auto page breaks and write per-area JSON/YAML/TOON when requested (CLI option appears only when COM is available).
|
|
16
16
|
- **Formats**: JSON (compact by default, `--pretty` available), YAML, TOON (optional dependencies).
|
|
17
17
|
- **Table detection tuning**: adjust heuristics at runtime via API.
|
|
@@ -380,6 +380,27 @@ This project is suitable for teams that:
|
|
|
380
380
|
- Use CLI `--auto-page-breaks-dir` (COM only), `DestinationOptions.auto_page_breaks_dir` (preferred), or `export_auto_page_breaks(...)` to write per-auto-page-break files; the API raises `ValueError` if no auto page breaks exist.
|
|
381
381
|
- `PrintAreaView` includes rows and table candidates inside the area, plus shapes/charts that overlap the area (size-less shapes are treated as points). `normalize=True` rebases row/col indices to the area origin.
|
|
382
382
|
|
|
383
|
+
## Architecture
|
|
384
|
+
|
|
385
|
+
ExStruct uses a pipeline-based architecture that separates
|
|
386
|
+
extraction strategy (Backend) from orchestration (Pipeline)
|
|
387
|
+
and semantic modeling.
|
|
388
|
+
|
|
389
|
+
→ See: [docs/architecture/pipeline.md](docs/architecture/pipeline.md)
|
|
390
|
+
|
|
391
|
+
## Contributing
|
|
392
|
+
|
|
393
|
+
If you plan to extend ExStruct internals,
|
|
394
|
+
please read the contributor architecture guide.
|
|
395
|
+
|
|
396
|
+
→ [docs/contributors/architecture.md](docs/contributors/architecture.md)
|
|
397
|
+
|
|
398
|
+
## Note on coverage
|
|
399
|
+
|
|
400
|
+
The cell-structure inference logic (cells.py) relies on heuristic rules
|
|
401
|
+
and Excel-specific behaviors. Full coverage is intentionally not pursued,
|
|
402
|
+
as exhaustive testing would not reflect real-world reliability.
|
|
403
|
+
|
|
383
404
|
## License
|
|
384
405
|
|
|
385
406
|
BSD-3-Clause. See `LICENSE` for details.
|
|
@@ -1,128 +1,133 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "exstruct"
|
|
3
|
-
version = "0.3.
|
|
4
|
-
description = "Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines"
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
license = { file = "LICENSE" }
|
|
7
|
-
keywords = ["excel", "structure", "data", "exstruct"]
|
|
8
|
-
authors = [
|
|
9
|
-
{ name = "harumiWeb"}
|
|
10
|
-
]
|
|
11
|
-
requires-python = ">=3.11"
|
|
12
|
-
dependencies = [
|
|
13
|
-
"numpy>=2.3.5",
|
|
14
|
-
"openpyxl>=3.1.5",
|
|
15
|
-
"pandas>=2.3.3",
|
|
16
|
-
"pydantic>=2.12.5",
|
|
17
|
-
"scipy>=1.16.3",
|
|
18
|
-
"xlwings>=0.33.16",
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
[build-system]
|
|
22
|
-
requires = ["uv_build>=0.8.4,<0.9.0"]
|
|
23
|
-
build-backend = "uv_build"
|
|
24
|
-
|
|
25
|
-
[dependency-groups]
|
|
26
|
-
dev = [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"pytest
|
|
33
|
-
"pytest-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
ruff
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
1
|
+
[project]
|
|
2
|
+
name = "exstruct"
|
|
3
|
+
version = "0.3.1"
|
|
4
|
+
description = "Excel to structured JSON (tables, shapes, charts) for LLM/RAG pipelines"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { file = "LICENSE" }
|
|
7
|
+
keywords = ["excel", "structure", "data", "exstruct"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "harumiWeb"}
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"numpy>=2.3.5",
|
|
14
|
+
"openpyxl>=3.1.5",
|
|
15
|
+
"pandas>=2.3.3",
|
|
16
|
+
"pydantic>=2.12.5",
|
|
17
|
+
"scipy>=1.16.3",
|
|
18
|
+
"xlwings>=0.33.16",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["uv_build>=0.8.4,<0.9.0"]
|
|
23
|
+
build-backend = "uv_build"
|
|
24
|
+
|
|
25
|
+
[dependency-groups]
|
|
26
|
+
dev = [
|
|
27
|
+
"codecov-cli>=11.2.6",
|
|
28
|
+
"mkdocs-material>=9.7.0",
|
|
29
|
+
"mkdocstrings-python>=2.0.1",
|
|
30
|
+
"mypy>=1.19.0",
|
|
31
|
+
"pre-commit>=4.5.0",
|
|
32
|
+
"pytest>=9.0.1",
|
|
33
|
+
"pytest-cov>=7.0.0",
|
|
34
|
+
"pytest-mock>=3.15.1",
|
|
35
|
+
"ruff>=0.14.8",
|
|
36
|
+
"taskipy>=1.14.1",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
yaml = ["pyyaml>=6.0.3"]
|
|
41
|
+
toon = ["python-toon>=0.1.3"]
|
|
42
|
+
render = ["pypdfium2>=5.1.0", "Pillow>=12.0.0"]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
exstruct = "exstruct.cli.main:main"
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://harumiweb.github.io/exstruct/"
|
|
49
|
+
Repository = "https://github.com/harumiWeb/exstruct"
|
|
50
|
+
Issues = "https://github.com/harumiWeb/exstruct/issues"
|
|
51
|
+
Documentation = "https://harumiweb.github.io/exstruct/"
|
|
52
|
+
|
|
53
|
+
[tool.coverage.run]
|
|
54
|
+
omit = [
|
|
55
|
+
"tests/*",
|
|
56
|
+
"*/test_*.py",
|
|
57
|
+
"*/gen_py/*",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.ruff]
|
|
61
|
+
target-version = "py311"
|
|
62
|
+
src = ["exstruct"]
|
|
63
|
+
|
|
64
|
+
select = [
|
|
65
|
+
"E", # pycodestyle errors
|
|
66
|
+
"W", # pycodestyle warnings
|
|
67
|
+
"F", # pyflakes
|
|
68
|
+
"I", # import sorting
|
|
69
|
+
"UP", # pyupgrade
|
|
70
|
+
"B", # flake8-bugbear
|
|
71
|
+
"N", # naming
|
|
72
|
+
"C90", # complexity
|
|
73
|
+
"A", # flake8-builtins
|
|
74
|
+
"ANN", # type annotations
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
ignore = [
|
|
78
|
+
"E501", # 行長は許容(Excel JSON は長くなりがち)
|
|
79
|
+
"B008", # Pydantic の default_factory を誤検知するため
|
|
80
|
+
"ANN101", # self に型を要求されてしまうため
|
|
81
|
+
"ANN102", # cls も同様
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
fix = true
|
|
85
|
+
|
|
86
|
+
# 型ヒントのスタイル
|
|
87
|
+
[tool.ruff.lint]
|
|
88
|
+
extend-select = ["ANN"]
|
|
89
|
+
|
|
90
|
+
# import の並び替え設定
|
|
91
|
+
[tool.ruff.isort]
|
|
92
|
+
combine-as-imports = true
|
|
93
|
+
known-first-party = ["exstruct"]
|
|
94
|
+
force-sort-within-sections = true
|
|
95
|
+
|
|
96
|
+
# 複雑度チェック(関数の最大複雑度)
|
|
97
|
+
[tool.ruff.mccabe]
|
|
98
|
+
max-complexity = 12
|
|
99
|
+
|
|
100
|
+
[tool.ruff.per-file-ignores]
|
|
101
|
+
"tests/**/*.py" = ["N802", "N803", "N806"]
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
[tool.mypy]
|
|
105
|
+
packages = ["exstruct"]
|
|
106
|
+
python_version = "3.11"
|
|
107
|
+
|
|
108
|
+
# 外部ライブラリは一切チェックしない
|
|
109
|
+
ignore_missing_imports = true
|
|
110
|
+
|
|
111
|
+
# 自作コードは厳密にチェックする
|
|
112
|
+
strict = true
|
|
113
|
+
|
|
114
|
+
# Pydantic v2 向け
|
|
115
|
+
plugins = ["pydantic.mypy"]
|
|
116
|
+
|
|
117
|
+
[tool.pytest.ini_options]
|
|
118
|
+
markers = [
|
|
119
|
+
"com: requires Excel COM (Windows + Excel)",
|
|
120
|
+
"render: requires Excel COM and pypdfium2; set RUN_RENDER_SMOKE=1 to enable",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[tool.taskipy.tasks]
|
|
124
|
+
ruff = "ruff check ."
|
|
125
|
+
ruff-fix = "ruff check . --fix"
|
|
126
|
+
mypy = "mypy src/exstruct --strict"
|
|
127
|
+
test = "pytest -vv --cov=exstruct --cov-report=term-missing --cov-report=xml" # uv sync --extra render --extra toon
|
|
128
|
+
test-unit = "pytest -vv -m \"not com and not render\" --cov=exstruct --cov-report=term-missing --cov-report=xml"
|
|
129
|
+
test-com = "pytest -vv -m \"com\" --cov=exstruct --cov-report=term-missing --cov-report=xml"
|
|
130
|
+
codecov-unit = "codecov-cli upload-process -f coverage.xml -F unit -C %CODECOV_SHA% -t %CODECOV_TOKEN%"
|
|
131
|
+
codecov-com = "codecov-cli upload-process -f coverage.xml -F com -C %CODECOV_SHA% -t %CODECOV_TOKEN%"
|
|
132
|
+
docs = "mkdocs serve"
|
|
133
|
+
build-docs = "mkdocs build && python scripts/gen_json_schema.py && python scripts/gen_model_docs.py"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from .base import Backend
|
|
4
|
-
from .com_backend import ComBackend
|
|
5
|
-
from .openpyxl_backend import OpenpyxlBackend
|
|
6
|
-
|
|
7
|
-
__all__ = ["Backend", "ComBackend", "OpenpyxlBackend"]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .base import Backend
|
|
4
|
+
from .com_backend import ComBackend
|
|
5
|
+
from .openpyxl_backend import OpenpyxlBackend
|
|
6
|
+
|
|
7
|
+
__all__ = ["Backend", "ComBackend", "OpenpyxlBackend"]
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Protocol
|
|
5
|
-
|
|
6
|
-
from ...models import CellRow, PrintArea
|
|
7
|
-
from ..cells import WorkbookColorsMap
|
|
8
|
-
|
|
9
|
-
CellData = dict[str, list[CellRow]]
|
|
10
|
-
PrintAreaData = dict[str, list[PrintArea]]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@dataclass(frozen=True)
|
|
14
|
-
class BackendConfig:
|
|
15
|
-
"""Configuration options shared across backends.
|
|
16
|
-
|
|
17
|
-
Attributes:
|
|
18
|
-
include_default_background: Whether to include default background colors.
|
|
19
|
-
ignore_colors: Optional set of color keys to ignore.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
include_default_background: bool
|
|
23
|
-
ignore_colors: set[str] | None
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class Backend(Protocol):
|
|
27
|
-
"""Protocol for backend implementations."""
|
|
28
|
-
|
|
29
|
-
def extract_cells(self, *, include_links: bool) -> CellData:
|
|
30
|
-
"""Extract cell rows from the workbook."""
|
|
31
|
-
|
|
32
|
-
def extract_print_areas(self) -> PrintAreaData:
|
|
33
|
-
"""Extract print areas from the workbook."""
|
|
34
|
-
|
|
35
|
-
def extract_colors_map(
|
|
36
|
-
self, *, include_default_background: bool, ignore_colors: set[str] | None
|
|
37
|
-
) -> WorkbookColorsMap | None:
|
|
38
|
-
"""Extract colors map from the workbook."""
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Protocol
|
|
5
|
+
|
|
6
|
+
from ...models import CellRow, PrintArea
|
|
7
|
+
from ..cells import WorkbookColorsMap
|
|
8
|
+
|
|
9
|
+
CellData = dict[str, list[CellRow]]
|
|
10
|
+
PrintAreaData = dict[str, list[PrintArea]]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class BackendConfig:
|
|
15
|
+
"""Configuration options shared across backends.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
include_default_background: Whether to include default background colors.
|
|
19
|
+
ignore_colors: Optional set of color keys to ignore.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
include_default_background: bool
|
|
23
|
+
ignore_colors: set[str] | None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Backend(Protocol):
|
|
27
|
+
"""Protocol for backend implementations."""
|
|
28
|
+
|
|
29
|
+
def extract_cells(self, *, include_links: bool) -> CellData:
|
|
30
|
+
"""Extract cell rows from the workbook."""
|
|
31
|
+
|
|
32
|
+
def extract_print_areas(self) -> PrintAreaData:
|
|
33
|
+
"""Extract print areas from the workbook."""
|
|
34
|
+
|
|
35
|
+
def extract_colors_map(
|
|
36
|
+
self, *, include_default_background: bool, ignore_colors: set[str] | None
|
|
37
|
+
) -> WorkbookColorsMap | None:
|
|
38
|
+
"""Extract colors map from the workbook."""
|