fillxl 0.2.0__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,224 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # Generated demo output
30
+ filled_templates/
31
+
32
+ # Development artifacts
33
+ scripts/__pycache__/
34
+
35
+ # PyInstaller
36
+ # Usually these files are written by a python script from a template
37
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
38
+ *.manifest
39
+ *.spec
40
+
41
+ # Installer logs
42
+ pip-log.txt
43
+ pip-delete-this-directory.txt
44
+
45
+ # Unit test / coverage reports
46
+ htmlcov/
47
+ .tox/
48
+ .nox/
49
+ .coverage
50
+ .coverage.*
51
+ *.cover
52
+ *.py.cover
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ .hypothesis/
57
+ .pytest_cache/
58
+ cover/
59
+
60
+ # Translations
61
+ *.mo
62
+ *.pot
63
+
64
+ # Django stuff:
65
+ *.log
66
+ local_settings.py
67
+ db.sqlite3
68
+ db.sqlite3-journal
69
+
70
+ # Flask stuff:
71
+ instance/
72
+ .webassets-cache
73
+
74
+ # Scrapy stuff:
75
+ .scrapy
76
+
77
+ # Sphinx documentation
78
+ docs/_build/
79
+
80
+ # PyBuilder
81
+ .pybuilder/
82
+ target/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # pyenv
92
+ # For a library or package, you might want to ignore these files since the code is
93
+ # intended to run in multiple environments; otherwise, check them in:
94
+ # .python-version
95
+
96
+ # pipenv
97
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
99
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
100
+ # install all needed dependencies.
101
+ # Pipfile.lock
102
+
103
+ # UV
104
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # uv.lock
108
+
109
+ # poetry
110
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
111
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
112
+ # commonly ignored for libraries.
113
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
114
+ # poetry.lock
115
+ # poetry.toml
116
+
117
+ # pdm
118
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
119
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
120
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
121
+ # pdm.lock
122
+ # pdm.toml
123
+ .pdm-python
124
+ .pdm-build/
125
+
126
+ # pixi
127
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
128
+ # pixi.lock
129
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
130
+ # in the .venv directory. It is recommended not to include this directory in version control.
131
+ .pixi
132
+
133
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
134
+ __pypackages__/
135
+
136
+ # Celery stuff
137
+ celerybeat-schedule
138
+ celerybeat.pid
139
+
140
+ # Redis
141
+ *.rdb
142
+ *.aof
143
+ *.pid
144
+
145
+ # RabbitMQ
146
+ mnesia/
147
+ rabbitmq/
148
+ rabbitmq-data/
149
+
150
+ # ActiveMQ
151
+ activemq-data/
152
+
153
+ # SageMath parsed files
154
+ *.sage.py
155
+
156
+ # Environments
157
+ .env
158
+ .envrc
159
+ .venv
160
+ env/
161
+ venv/
162
+ ENV/
163
+ env.bak/
164
+ venv.bak/
165
+
166
+ # Spyder project settings
167
+ .spyderproject
168
+ .spyproject
169
+
170
+ # Rope project settings
171
+ .ropeproject
172
+
173
+ # mkdocs documentation
174
+ /site
175
+
176
+ # mypy
177
+ .mypy_cache/
178
+ .dmypy.json
179
+ dmypy.json
180
+
181
+ # Pyre type checker
182
+ .pyre/
183
+
184
+ # pytype static type analyzer
185
+ .pytype/
186
+
187
+ # Cython debug symbols
188
+ cython_debug/
189
+
190
+ # PyCharm
191
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
192
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
193
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
194
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
195
+ # .idea/
196
+
197
+ # Abstra
198
+ # Abstra is an AI-powered process automation framework.
199
+ # Ignore directories containing user credentials, local state, and settings.
200
+ # Learn more at https://abstra.io/docs
201
+ .abstra/
202
+
203
+ # Visual Studio Code
204
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
205
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
206
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
207
+ # you could uncomment the following to ignore the entire vscode folder
208
+ # .vscode/
209
+ # Temporary file for partial code execution
210
+ tempCodeRunnerFile.py
211
+
212
+ # Ruff stuff:
213
+ .ruff_cache/
214
+
215
+ # PyPI configuration file
216
+ .pypirc
217
+
218
+ # Marimo
219
+ marimo/_static/
220
+ marimo/_lsp/
221
+ __marimo__/
222
+
223
+ # Streamlit
224
+ .streamlit/secrets.toml
fillxl-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hirolau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
fillxl-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,236 @@
1
+ Metadata-Version: 2.4
2
+ Name: fillxl
3
+ Version: 0.2.0
4
+ Summary: Fill Excel templates with data from Python.
5
+ Project-URL: Homepage, https://github.com/hirolau/fillxl
6
+ Project-URL: Source, https://github.com/hirolau/fillxl
7
+ Project-URL: Issues, https://github.com/hirolau/fillxl/issues
8
+ Author-email: hirolau <hirolau@users.noreply.github.com>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 hirolau
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: automation,excel,fillxl,templates
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Natural Language :: English
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Classifier: Programming Language :: Python :: 3.14
41
+ Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
42
+ Requires-Python: >=3.11
43
+ Requires-Dist: attrs>=23.0
44
+ Requires-Dist: openpyxl>=3.1.5
45
+ Provides-Extra: all
46
+ Requires-Dist: duckdb>=0.9; extra == 'all'
47
+ Requires-Dist: pandas>=2.0; extra == 'all'
48
+ Requires-Dist: polars>=0.20; extra == 'all'
49
+ Requires-Dist: pywin32>=306; (sys_platform == 'win32') and extra == 'all'
50
+ Provides-Extra: dev
51
+ Requires-Dist: check-wheel-contents>=0.6; extra == 'dev'
52
+ Requires-Dist: coverage>=7; extra == 'dev'
53
+ Requires-Dist: mypy>=1.10; extra == 'dev'
54
+ Requires-Dist: nox>=2023.12; extra == 'dev'
55
+ Requires-Dist: pandas-stubs>=2; extra == 'dev'
56
+ Requires-Dist: pyrefly>=1.0; extra == 'dev'
57
+ Requires-Dist: pytest-cov>=4; extra == 'dev'
58
+ Requires-Dist: pytest-gremlins>=1.9.0; extra == 'dev'
59
+ Requires-Dist: pytest-spec>=6.1.0; extra == 'dev'
60
+ Requires-Dist: pytest>=7; extra == 'dev'
61
+ Requires-Dist: ruff>=0.1; extra == 'dev'
62
+ Requires-Dist: twine>=6; extra == 'dev'
63
+ Requires-Dist: xlwings>=0.30; extra == 'dev'
64
+ Provides-Extra: duckdb
65
+ Requires-Dist: duckdb>=0.9; extra == 'duckdb'
66
+ Provides-Extra: pandas
67
+ Requires-Dist: pandas>=2.0; extra == 'pandas'
68
+ Provides-Extra: polars
69
+ Requires-Dist: polars>=0.20; extra == 'polars'
70
+ Provides-Extra: test
71
+ Requires-Dist: duckdb>=1.5.4; extra == 'test'
72
+ Requires-Dist: hypothesis>=6.156.3; extra == 'test'
73
+ Requires-Dist: pandas>=3.0.3; extra == 'test'
74
+ Requires-Dist: polars>=1.42.1; extra == 'test'
75
+ Provides-Extra: win32com
76
+ Requires-Dist: pywin32>=306; (sys_platform == 'win32') and extra == 'win32com'
77
+ Description-Content-Type: text/markdown
78
+
79
+ # fillxl
80
+
81
+ [![PyPI version](https://img.shields.io/pypi/v/fillxl.svg)](https://pypi.org/project/fillxl/)
82
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
83
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](pyproject.toml)
84
+ [![CI](https://github.com/hirolau/fillxl/actions/workflows/ci.yml/badge.svg)](https://github.com/hirolau/fillxl/actions/workflows/ci.yml)
85
+
86
+ **Fill Excel templates with data from Python.**
87
+
88
+ Designed around named cells and Excel tables — no more fragile cell references like A1 or B3. Charts, formulas, formatting, and conditional formatting are preserved and updated automatically.
89
+
90
+ Fill tables using list, pandas, polars or duckdb!
91
+
92
+ ```python
93
+ from fillxl import fill
94
+ import pandas as pd
95
+
96
+ fill(
97
+ template="report_template.xlsx",
98
+ output="q4_report.xlsx",
99
+ tables={
100
+ "Products": [
101
+ {"Name": "Widget", "Price": 4.99, "Sold": 150},
102
+ {"Name": "Gadget", "Price": 9.99, "Sold": 85},
103
+ ],
104
+ "Sales": pd.read_csv('sales_data.csv'),
105
+ },
106
+ values={
107
+ "ReportTitle": "Q4 2024 Sales",
108
+ "PreparedBy": "Alice",
109
+ },
110
+ )
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Installation
116
+
117
+ ```bash
118
+ pip install fillxl
119
+ ```
120
+
121
+ Optional extras:
122
+
123
+ ```bash
124
+ pip install fillxl[pandas] # pandas support
125
+ pip install fillxl[all] # pandas + polars + duckdb
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Quick Start
131
+
132
+ 1. In Excel, create **named cells** (Name Manager) for single values and **Excel Tables** (`Ctrl + T`) for tabular data.
133
+ 2. Fill the template with the code above.
134
+
135
+ Tables are automatically resized, charts updated, and all formatting preserved.
136
+
137
+ **Backend (optional)**
138
+
139
+ ```python
140
+ fill(..., engine="openpyxl") # default, cross-platform
141
+ fill(..., engine="win32com") # Windows + Excel installed (maximum fidelity)
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Visual Example
147
+
148
+ **Before filling:**
149
+
150
+ ![Before fill](docs/screenshots/before_fill.png)
151
+
152
+ **After filling:**
153
+
154
+ ![After fill](docs/screenshots/after_fill.png)
155
+
156
+ ---
157
+
158
+ ## Main Features
159
+
160
+ - Populate named cells and Excel tables
161
+ - Automatic table resizing + chart range updates
162
+ - Conditional formatting and pivot table refresh
163
+ - Two backends: `openpyxl` (default) and `win32com` (Windows + Excel)
164
+
165
+ ---
166
+
167
+ ## API
168
+
169
+ ### `fill()`
170
+
171
+ ```python
172
+ fill(
173
+ template: str | Path,
174
+ output: str | Path,
175
+ values: dict[str, Any] | None = None,
176
+ tables: dict[str, list[dict] | DataFrame | ...] | None = None,
177
+ *,
178
+ engine: str = "auto", # "openpyxl", "win32com"
179
+ config: FillXLConfig | None = None
180
+ ) -> Path
181
+ ```
182
+
183
+ See the full documentation for `FillXLConfig` options.
184
+
185
+ ---
186
+
187
+ ## Supported Data Sources
188
+
189
+ - `list[dict]`
190
+ - `dict[str, list]`
191
+ - `pandas.DataFrame`
192
+ - `polars.DataFrame`
193
+ - `duckdb.DuckDBPyRelation`
194
+
195
+ ---
196
+
197
+ ## Backends
198
+
199
+ | Engine | Cross-platform | Requires Excel | Best for |
200
+ |------------|----------------|----------------|------------------------------|
201
+ | `openpyxl` | Yes | No | Most use cases, Linux/macOS |
202
+ | `win32com` | Windows only | Yes | Modern charts, full fidelity |
203
+
204
+ ---
205
+
206
+ ## Performance
207
+
208
+ Benchmark: **5,000 rows × 20 columns** (list[dict] data).
209
+
210
+ | Method | Engine | Time (mean ± std) |
211
+ |---------------------------|------------|-------------------|
212
+ | `fillxl` | openpyxl | 2.26s ± 0.03s |
213
+ | `fillxl` | win32com | 2.80s ± 0.03s |
214
+ | `pandas.to_excel` | openpyxl | 3.01s ± 0.09s |
215
+
216
+ ---
217
+
218
+ ## Known Limitations
219
+
220
+ - `openpyxl` does not support dynamic arrays, `.xlsm`, or `.xlsb` files and drops some modern chart types.
221
+ - `win32com` requires Windows + Excel.
222
+ - Timezone-aware datetimes are converted to naive.
223
+
224
+ ---
225
+
226
+ ## Development
227
+
228
+ ```bash
229
+ git clone https://github.com/hirolau/fillxl.git
230
+ cd fillxl
231
+ uv sync --all-extras
232
+ uv run pytest
233
+ ```
234
+
235
+ **Supported:** Python 3.11–3.14, Windows/Linux (macOS best-effort).
236
+ **License:** [MIT](LICENSE)
fillxl-0.2.0/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # fillxl
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/fillxl.svg)](https://pypi.org/project/fillxl/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](pyproject.toml)
6
+ [![CI](https://github.com/hirolau/fillxl/actions/workflows/ci.yml/badge.svg)](https://github.com/hirolau/fillxl/actions/workflows/ci.yml)
7
+
8
+ **Fill Excel templates with data from Python.**
9
+
10
+ Designed around named cells and Excel tables — no more fragile cell references like A1 or B3. Charts, formulas, formatting, and conditional formatting are preserved and updated automatically.
11
+
12
+ Fill tables using list, pandas, polars or duckdb!
13
+
14
+ ```python
15
+ from fillxl import fill
16
+ import pandas as pd
17
+
18
+ fill(
19
+ template="report_template.xlsx",
20
+ output="q4_report.xlsx",
21
+ tables={
22
+ "Products": [
23
+ {"Name": "Widget", "Price": 4.99, "Sold": 150},
24
+ {"Name": "Gadget", "Price": 9.99, "Sold": 85},
25
+ ],
26
+ "Sales": pd.read_csv('sales_data.csv'),
27
+ },
28
+ values={
29
+ "ReportTitle": "Q4 2024 Sales",
30
+ "PreparedBy": "Alice",
31
+ },
32
+ )
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install fillxl
41
+ ```
42
+
43
+ Optional extras:
44
+
45
+ ```bash
46
+ pip install fillxl[pandas] # pandas support
47
+ pip install fillxl[all] # pandas + polars + duckdb
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Quick Start
53
+
54
+ 1. In Excel, create **named cells** (Name Manager) for single values and **Excel Tables** (`Ctrl + T`) for tabular data.
55
+ 2. Fill the template with the code above.
56
+
57
+ Tables are automatically resized, charts updated, and all formatting preserved.
58
+
59
+ **Backend (optional)**
60
+
61
+ ```python
62
+ fill(..., engine="openpyxl") # default, cross-platform
63
+ fill(..., engine="win32com") # Windows + Excel installed (maximum fidelity)
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Visual Example
69
+
70
+ **Before filling:**
71
+
72
+ ![Before fill](docs/screenshots/before_fill.png)
73
+
74
+ **After filling:**
75
+
76
+ ![After fill](docs/screenshots/after_fill.png)
77
+
78
+ ---
79
+
80
+ ## Main Features
81
+
82
+ - Populate named cells and Excel tables
83
+ - Automatic table resizing + chart range updates
84
+ - Conditional formatting and pivot table refresh
85
+ - Two backends: `openpyxl` (default) and `win32com` (Windows + Excel)
86
+
87
+ ---
88
+
89
+ ## API
90
+
91
+ ### `fill()`
92
+
93
+ ```python
94
+ fill(
95
+ template: str | Path,
96
+ output: str | Path,
97
+ values: dict[str, Any] | None = None,
98
+ tables: dict[str, list[dict] | DataFrame | ...] | None = None,
99
+ *,
100
+ engine: str = "auto", # "openpyxl", "win32com"
101
+ config: FillXLConfig | None = None
102
+ ) -> Path
103
+ ```
104
+
105
+ See the full documentation for `FillXLConfig` options.
106
+
107
+ ---
108
+
109
+ ## Supported Data Sources
110
+
111
+ - `list[dict]`
112
+ - `dict[str, list]`
113
+ - `pandas.DataFrame`
114
+ - `polars.DataFrame`
115
+ - `duckdb.DuckDBPyRelation`
116
+
117
+ ---
118
+
119
+ ## Backends
120
+
121
+ | Engine | Cross-platform | Requires Excel | Best for |
122
+ |------------|----------------|----------------|------------------------------|
123
+ | `openpyxl` | Yes | No | Most use cases, Linux/macOS |
124
+ | `win32com` | Windows only | Yes | Modern charts, full fidelity |
125
+
126
+ ---
127
+
128
+ ## Performance
129
+
130
+ Benchmark: **5,000 rows × 20 columns** (list[dict] data).
131
+
132
+ | Method | Engine | Time (mean ± std) |
133
+ |---------------------------|------------|-------------------|
134
+ | `fillxl` | openpyxl | 2.26s ± 0.03s |
135
+ | `fillxl` | win32com | 2.80s ± 0.03s |
136
+ | `pandas.to_excel` | openpyxl | 3.01s ± 0.09s |
137
+
138
+ ---
139
+
140
+ ## Known Limitations
141
+
142
+ - `openpyxl` does not support dynamic arrays, `.xlsm`, or `.xlsb` files and drops some modern chart types.
143
+ - `win32com` requires Windows + Excel.
144
+ - Timezone-aware datetimes are converted to naive.
145
+
146
+ ---
147
+
148
+ ## Development
149
+
150
+ ```bash
151
+ git clone https://github.com/hirolau/fillxl.git
152
+ cd fillxl
153
+ uv sync --all-extras
154
+ uv run pytest
155
+ ```
156
+
157
+ **Supported:** Python 3.11–3.14, Windows/Linux (macOS best-effort).
158
+ **License:** [MIT](LICENSE)