excelizarr 0.1.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.
Files changed (31) hide show
  1. excelizarr-0.1.0/LICENSE +232 -0
  2. excelizarr-0.1.0/PKG-INFO +127 -0
  3. excelizarr-0.1.0/README.md +86 -0
  4. excelizarr-0.1.0/pyproject.toml +207 -0
  5. excelizarr-0.1.0/setup.cfg +4 -0
  6. excelizarr-0.1.0/setup.py +11 -0
  7. excelizarr-0.1.0/src/excelizarr/__init__.py +35 -0
  8. excelizarr-0.1.0/src/excelizarr/_pandas.py +185 -0
  9. excelizarr-0.1.0/src/excelizarr/_refs.py +226 -0
  10. excelizarr-0.1.0/src/excelizarr/_version.py +21 -0
  11. excelizarr-0.1.0/src/excelizarr/api.py +155 -0
  12. excelizarr-0.1.0/src/excelizarr/exceptions.py +15 -0
  13. excelizarr-0.1.0/src/excelizarr/io_xlsx.py +195 -0
  14. excelizarr-0.1.0/src/excelizarr/io_zarr.py +563 -0
  15. excelizarr-0.1.0/src/excelizarr/kinds.py +154 -0
  16. excelizarr-0.1.0/src/excelizarr/model.py +391 -0
  17. excelizarr-0.1.0/src/excelizarr/workbook.py +442 -0
  18. excelizarr-0.1.0/src/excelizarr.egg-info/PKG-INFO +127 -0
  19. excelizarr-0.1.0/src/excelizarr.egg-info/SOURCES.txt +29 -0
  20. excelizarr-0.1.0/src/excelizarr.egg-info/dependency_links.txt +1 -0
  21. excelizarr-0.1.0/src/excelizarr.egg-info/requires.txt +27 -0
  22. excelizarr-0.1.0/src/excelizarr.egg-info/top_level.txt +1 -0
  23. excelizarr-0.1.0/tests/test_engines.py +56 -0
  24. excelizarr-0.1.0/tests/test_icechunk.py +69 -0
  25. excelizarr-0.1.0/tests/test_read_excel.py +115 -0
  26. excelizarr-0.1.0/tests/test_refs.py +109 -0
  27. excelizarr-0.1.0/tests/test_regions.py +90 -0
  28. excelizarr-0.1.0/tests/test_roundtrip.py +116 -0
  29. excelizarr-0.1.0/tests/test_stores.py +223 -0
  30. excelizarr-0.1.0/tests/test_workbook.py +157 -0
  31. excelizarr-0.1.0/versioneer.py +2334 -0
@@ -0,0 +1,232 @@
1
+ THE NOT FIT FOR PURPOSE LICENCE
2
+ (the Apache License 2.0, wearing a hat)
3
+
4
+ This tool is not fit for purpose. I don't care what your purpose is, this isn't
5
+ it.
6
+
7
+ It was written to find out whether a spreadsheet could be made cloud-native, a
8
+ question nobody asked, and because a friend saving spreadsheets as HDF5 made me
9
+ wonder.
10
+ I think it works, more or less. The property tests think so too, but they only
11
+ know about the spreadsheets they made up themselves. I make no guarantees.
12
+
13
+ In particular, it is not fit for: financial reporting; anything an auditor will
14
+ read; anything a regulator will read; anything your boss's boss will read; the
15
+ model that decides interest rates, dosages, or whether the bridge stays up; or
16
+ as a substitute for just keeping the .xlsx.
17
+
18
+ If you find yourself storing a mission-critical spreadsheet in an object store as
19
+ seven aligned typed arrays, please stop and reflect on the choices that led you
20
+ here. Then use at your own risk.
21
+
22
+ (Preamble adapted, with admiration, from Kai Striega's parquet-summary:
23
+ https://github.com/Kai-Striega/parquet-summary)
24
+
25
+ The preamble above is a joke and grants or withholds nothing. The actual terms
26
+ are those of the Apache License, Version 2.0, reproduced unmodified below.
27
+ Section 7 ("Disclaimer of Warranty") says the serious version of everything
28
+ above, in capital letters.
29
+
30
+ --------------------------------------------------------------------------------
31
+
32
+ Apache License
33
+ Version 2.0, January 2004
34
+ http://www.apache.org/licenses/
35
+
36
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
37
+
38
+ 1. Definitions.
39
+
40
+ "License" shall mean the terms and conditions for use, reproduction,
41
+ and distribution as defined by Sections 1 through 9 of this document.
42
+
43
+ "Licensor" shall mean the copyright owner or entity authorized by
44
+ the copyright owner that is granting the License.
45
+
46
+ "Legal Entity" shall mean the union of the acting entity and all
47
+ other entities that control, are controlled by, or are under common
48
+ control with that entity. For the purposes of this definition,
49
+ "control" means (i) the power, direct or indirect, to cause the
50
+ direction or management of such entity, whether by contract or
51
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
52
+ outstanding shares, or (iii) beneficial ownership of such entity.
53
+
54
+ "You" (or "Your") shall mean an individual or Legal Entity
55
+ exercising permissions granted by this License.
56
+
57
+ "Source" form shall mean the preferred form for making modifications,
58
+ including but not limited to software source code, documentation
59
+ source, and configuration files.
60
+
61
+ "Object" form shall mean any form resulting from mechanical
62
+ transformation or translation of a Source form, including but
63
+ not limited to compiled object code, generated documentation,
64
+ and conversions to other media types.
65
+
66
+ "Work" shall mean the work of authorship, whether in Source or
67
+ Object form, made available under the License, as indicated by a
68
+ copyright notice that is included in or attached to the work
69
+ (an example is provided in the Appendix below).
70
+
71
+ "Derivative Works" shall mean any work, whether in Source or Object
72
+ form, that is based on (or derived from) the Work and for which the
73
+ editorial revisions, annotations, elaborations, or other modifications
74
+ represent, as a whole, an original work of authorship. For the purposes
75
+ of this License, Derivative Works shall not include works that remain
76
+ separable from, or merely link (or bind by name) to the interfaces of,
77
+ the Work and Derivative Works thereof.
78
+
79
+ "Contribution" shall mean any work of authorship, including
80
+ the original version of the Work and any modifications or additions
81
+ to that Work or Derivative Works thereof, that is intentionally
82
+ submitted to Licensor for inclusion in the Work by the copyright owner
83
+ or by an individual or Legal Entity authorized to submit on behalf of
84
+ the copyright owner. For the purposes of this definition, "submitted"
85
+ means any form of electronic, verbal, or written communication sent
86
+ to the Licensor or its representatives, including but not limited to
87
+ communication on electronic mailing lists, source code control systems,
88
+ and issue tracking systems that are managed by, or on behalf of, the
89
+ Licensor for the purpose of discussing and improving the Work, but
90
+ excluding communication that is conspicuously marked or otherwise
91
+ designated in writing by the copyright owner as "Not a Contribution."
92
+
93
+ "Contributor" shall mean Licensor and any individual or Legal Entity
94
+ on behalf of whom a Contribution has been received by Licensor and
95
+ subsequently incorporated within the Work.
96
+
97
+ 2. Grant of Copyright License. Subject to the terms and conditions of
98
+ this License, each Contributor hereby grants to You a perpetual,
99
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
100
+ copyright license to reproduce, prepare Derivative Works of,
101
+ publicly display, publicly perform, sublicense, and distribute the
102
+ Work and such Derivative Works in Source or Object form.
103
+
104
+ 3. Grant of Patent License. Subject to the terms and conditions of
105
+ this License, each Contributor hereby grants to You a perpetual,
106
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
107
+ (except as stated in this section) patent license to make, have made,
108
+ use, offer to sell, sell, import, and otherwise transfer the Work,
109
+ where such license applies only to those patent claims licensable
110
+ by such Contributor that are necessarily infringed by their
111
+ Contribution(s) alone or by combination of their Contribution(s)
112
+ with the Work to which such Contribution(s) was submitted. If You
113
+ institute patent litigation against any entity (including a
114
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
115
+ or a Contribution incorporated within the Work constitutes direct
116
+ or contributory patent infringement, then any patent licenses
117
+ granted to You under this License for that Work shall terminate
118
+ as of the date such litigation is filed.
119
+
120
+ 4. Redistribution. You may reproduce and distribute copies of the
121
+ Work or Derivative Works thereof in any medium, with or without
122
+ modifications, and in Source or Object form, provided that You
123
+ meet the following conditions:
124
+
125
+ (a) You must give any other recipients of the Work or
126
+ Derivative Works a copy of this License; and
127
+
128
+ (b) You must cause any modified files to carry prominent notices
129
+ stating that You changed the files; and
130
+
131
+ (c) You must retain, in the Source form of any Derivative Works
132
+ that You distribute, all copyright, patent, trademark, and
133
+ attribution notices from the Source form of the Work,
134
+ excluding those notices that do not pertain to any part of
135
+ the Derivative Works; and
136
+
137
+ (d) If the Work includes a "NOTICE" text file as part of its
138
+ distribution, then any Derivative Works that You distribute must
139
+ include a readable copy of the attribution notices contained
140
+ within such NOTICE file, excluding those notices that do not
141
+ pertain to any part of the Derivative Works, in at least one
142
+ of the following places: within a NOTICE text file distributed
143
+ as part of the Derivative Works; within the Source form or
144
+ documentation, if provided along with the Derivative Works; or,
145
+ within a display generated by the Derivative Works, if and
146
+ wherever such third-party notices normally appear. The contents
147
+ of the NOTICE file are for informational purposes only and
148
+ do not modify the License. You may add Your own attribution
149
+ notices within Derivative Works that You distribute, alongside
150
+ or as an addendum to the NOTICE text from the Work, provided
151
+ that such additional attribution notices cannot be construed
152
+ as modifying the License.
153
+
154
+ You may add Your own copyright statement to Your modifications and
155
+ may provide additional or different license terms and conditions
156
+ for use, reproduction, or distribution of Your modifications, or
157
+ for any such Derivative Works as a whole, provided Your use,
158
+ reproduction, and distribution of the Work otherwise complies with
159
+ the conditions stated in this License.
160
+
161
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
162
+ any Contribution intentionally submitted for inclusion in the Work
163
+ by You to the Licensor shall be under the terms and conditions of
164
+ this License, without any additional terms or conditions.
165
+ Notwithstanding the above, nothing herein shall supersede or modify
166
+ the terms of any separate license agreement you may have executed
167
+ with Licensor regarding such Contributions.
168
+
169
+ 6. Trademarks. This License does not grant permission to use the trade
170
+ names, trademarks, service marks, or product names of the Licensor,
171
+ except as required for reasonable and customary use in describing the
172
+ origin of the Work and reproducing the content of the NOTICE file.
173
+
174
+ 7. Disclaimer of Warranty. Unless required by applicable law or
175
+ agreed to in writing, Licensor provides the Work (and each
176
+ Contributor provides its Contributions) on an "AS IS" BASIS,
177
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
178
+ implied, including, without limitation, any warranties or conditions
179
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
180
+ PARTICULAR PURPOSE. You are solely responsible for determining the
181
+ appropriateness of using or redistributing the Work and assume any
182
+ risks associated with Your exercise of permissions under this License.
183
+
184
+ 8. Limitation of Liability. In no event and under no legal theory,
185
+ whether in tort (including negligence), contract, or otherwise,
186
+ unless required by applicable law (such as deliberate and grossly
187
+ negligent acts) or agreed to in writing, shall any Contributor be
188
+ liable to You for damages, including any direct, indirect, special,
189
+ incidental, or consequential damages of any character arising as a
190
+ result of this License or out of the use or inability to use the
191
+ Work (including but not limited to damages for loss of goodwill,
192
+ work stoppage, computer failure or malfunction, or any and all
193
+ other commercial damages or losses), even if such Contributor
194
+ has been advised of the possibility of such damages.
195
+
196
+ 9. Accepting Warranty or Additional Liability. While redistributing
197
+ the Work or Derivative Works thereof, You may choose to offer,
198
+ and charge a fee for, acceptance of support, warranty, indemnity,
199
+ or other liability obligations and/or rights consistent with this
200
+ License. However, in accepting such obligations, You may act only
201
+ on Your own behalf and on Your sole responsibility, not on behalf
202
+ of any other Contributor, and only if You agree to indemnify,
203
+ defend, and hold each Contributor harmless for any liability
204
+ incurred by, or claims asserted against, such Contributor by reason
205
+ of your accepting any such warranty or additional liability.
206
+
207
+ END OF TERMS AND CONDITIONS
208
+
209
+ APPENDIX: How to apply the Apache License to your work.
210
+
211
+ To apply the Apache License to your work, attach the following
212
+ boilerplate notice, with the fields enclosed by brackets "[]"
213
+ replaced with your own identifying information. (Don't include
214
+ the brackets!) The text should be enclosed in the appropriate
215
+ comment syntax for the file format. We also recommend that a
216
+ file or class name and description of purpose be included on the
217
+ same "printed page" as the copyright notice for easier
218
+ identification within third-party archives.
219
+
220
+ Copyright 2026 Charles Turner
221
+
222
+ Licensed under the Apache License, Version 2.0 (the "License");
223
+ you may not use this file except in compliance with the License.
224
+ You may obtain a copy of the License at
225
+
226
+ http://www.apache.org/licenses/LICENSE-2.0
227
+
228
+ Unless required by applicable law or agreed to in writing, software
229
+ distributed under the License is distributed on an "AS IS" BASIS,
230
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
231
+ See the License for the specific language governing permissions and
232
+ limitations under the License.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: excelizarr
3
+ Version: 0.1.0
4
+ Summary: A cloud-native representation of an .xlsx workbook, in Zarr. Yes, really.
5
+ Author-email: Charles Turner <charles.turner@anu.edu.au>
6
+ Maintainer-email: Charles Turner <charles.turner@anu.edu.au>
7
+ License: Apache Software License 2.0
8
+ Project-URL: bugs, https://github.com/charles-turner-1/excelizarr/issues
9
+ Project-URL: homepage, https://github.com/charles-turner-1/excelizarr
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.12
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: numpy
18
+ Requires-Dist: openpyxl
19
+ Requires-Dist: pandas
20
+ Requires-Dist: zarr>=3.3
21
+ Provides-Extra: fast
22
+ Requires-Dist: python-calamine; extra == "fast"
23
+ Provides-Extra: icechunk
24
+ Requires-Dist: icechunk; extra == "icechunk"
25
+ Provides-Extra: dev
26
+ Requires-Dist: black; extra == "dev"
27
+ Requires-Dist: coverage; extra == "dev"
28
+ Requires-Dist: hypothesis; extra == "dev"
29
+ Requires-Dist: mypy; extra == "dev"
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Provides-Extra: docs
33
+ Requires-Dist: sphinx>=8; extra == "docs"
34
+ Requires-Dist: myst-nb>=1.2; extra == "docs"
35
+ Requires-Dist: pydata-sphinx-theme>=0.16; extra == "docs"
36
+ Requires-Dist: sphinx-design; extra == "docs"
37
+ Requires-Dist: sphinx-copybutton; extra == "docs"
38
+ Requires-Dist: ipykernel; extra == "docs"
39
+ Requires-Dist: icechunk; extra == "docs"
40
+ Dynamic: license-file
41
+
42
+ # excelizarr
43
+
44
+ **A cloud-native representation of an `.xlsx` workbook. In Zarr. Yes, really.**
45
+
46
+ > [!WARNING]
47
+ > This is a bit of fun. It works and it's property-tested, but please don't put it
48
+ > anywhere important. Claude wrote most of the code at my direction.
49
+
50
+ A friend made me realise you could save an `.xlsx` spreadsheet as an HDF5 file. That
51
+ raised an obvious question: why not Zarr? Then a workbook is chunked, compressed and
52
+ cloud-readable, and with [Icechunk](https://icechunk.io) it's version-controlled too.
53
+
54
+ ```python
55
+ import excelizarr as xz
56
+
57
+ wb = xz.xlsx_to_zarr("model.xlsx", "s3://bucket/model.zarr")
58
+
59
+ wb["Inputs!B2:D10"] # fetches a few chunks
60
+ df = xz.read_excel("s3://bucket/model.zarr", sheet_name="Inputs") # == pd.read_excel
61
+ xz.zarr_to_xlsx("s3://bucket/model.zarr", "roundtrip.xlsx") # formulas intact
62
+ ```
63
+
64
+ ## How it works
65
+
66
+ Each sheet becomes a zarr group of aligned, chunked (and sharded) 2D arrays:
67
+
68
+ - `kind`: which type each cell holds
69
+ - one array per value type: `number`, `string`, `bool`, `temporal`
70
+ - `formula` and `numfmt`
71
+
72
+ Zarr never writes a chunk that's all fill value, so unused types and empty space cost
73
+ nothing. A range read fetches only the chunks it overlaps, and the root's consolidated
74
+ metadata means opening a workbook is a single read. See
75
+ [the format](docs/guide/format.md).
76
+
77
+ - **`read_excel` parity.** `xz.read_excel` runs pandas' own Excel parser over the stored
78
+ cells, so every keyword behaves the same, and a hypothesis property checks the frames
79
+ match.
80
+ - **Round trips.** Formulas, number formats, merged cells, column widths, frozen panes
81
+ and defined names all survive xlsx → zarr → xlsx.
82
+ - **Any zarr store.** Local, `s3://`, in memory, a `ZipStore`, or an Icechunk session.
83
+ - **In-place edits.** `wb["Inputs"]["B2"] = 42` rewrites the one shard that cell is in.
84
+
85
+ ## Is it fast?
86
+
87
+ On a 50,000 × 20 sheet ([details](docs/guide/benchmarks.md)):
88
+
89
+ | read | seconds |
90
+ |---|---:|
91
+ | `pd.read_excel` (openpyxl) | 2.97 |
92
+ | `pd.read_excel` (calamine) | 0.63 |
93
+ | `pd.read_hdf` | **0.017** |
94
+ | `xz.read_excel` | 0.22 |
95
+ | 100-cell range read | **0.004** |
96
+
97
+ So HDF is still the right call for "the whole sheet as a DataFrame, fast". excelizarr
98
+ is 14× faster than parsing the `.xlsx`, smaller on disk than either, and much better
99
+ at the cloud-shaped jobs: range reads, partial access and version control.
100
+
101
+ From S3 (`ap-southeast-2`, from Australia), on a 500,000 × 20 sheet
102
+ ([details](docs/guide/cloud.md#whole-sheets)):
103
+
104
+ | read | seconds |
105
+ |---|---:|
106
+ | `pd.read_excel` (openpyxl) | 34.76 |
107
+ | `pd.read_excel` (calamine) | 8.26 |
108
+ | download + `pd.read_hdf` | **1.99** |
109
+ | `xz.read_excel` | 2.96 |
110
+ | open + 100-cell range read | **0.48** |
111
+
112
+ The range read costs the same at 10,000 rows as at 500,000: it only ever fetches the
113
+ chunks it needs.
114
+
115
+ ## Development
116
+
117
+ ```bash
118
+ pixi run test # hypothesis-heavy test suite
119
+ pixi run -e docs docs # executed MyST docs, warnings are errors
120
+ pixi run -e bench bench # the benchmark above
121
+ ```
122
+
123
+ ## Licence
124
+
125
+ [The Not Fit For Purpose Licence](LICENSE), which is the Apache License 2.0 with a
126
+ preamble. This tool is not fit for purpose. I don't care what your purpose is, this
127
+ isn't it.
@@ -0,0 +1,86 @@
1
+ # excelizarr
2
+
3
+ **A cloud-native representation of an `.xlsx` workbook. In Zarr. Yes, really.**
4
+
5
+ > [!WARNING]
6
+ > This is a bit of fun. It works and it's property-tested, but please don't put it
7
+ > anywhere important. Claude wrote most of the code at my direction.
8
+
9
+ A friend made me realise you could save an `.xlsx` spreadsheet as an HDF5 file. That
10
+ raised an obvious question: why not Zarr? Then a workbook is chunked, compressed and
11
+ cloud-readable, and with [Icechunk](https://icechunk.io) it's version-controlled too.
12
+
13
+ ```python
14
+ import excelizarr as xz
15
+
16
+ wb = xz.xlsx_to_zarr("model.xlsx", "s3://bucket/model.zarr")
17
+
18
+ wb["Inputs!B2:D10"] # fetches a few chunks
19
+ df = xz.read_excel("s3://bucket/model.zarr", sheet_name="Inputs") # == pd.read_excel
20
+ xz.zarr_to_xlsx("s3://bucket/model.zarr", "roundtrip.xlsx") # formulas intact
21
+ ```
22
+
23
+ ## How it works
24
+
25
+ Each sheet becomes a zarr group of aligned, chunked (and sharded) 2D arrays:
26
+
27
+ - `kind`: which type each cell holds
28
+ - one array per value type: `number`, `string`, `bool`, `temporal`
29
+ - `formula` and `numfmt`
30
+
31
+ Zarr never writes a chunk that's all fill value, so unused types and empty space cost
32
+ nothing. A range read fetches only the chunks it overlaps, and the root's consolidated
33
+ metadata means opening a workbook is a single read. See
34
+ [the format](docs/guide/format.md).
35
+
36
+ - **`read_excel` parity.** `xz.read_excel` runs pandas' own Excel parser over the stored
37
+ cells, so every keyword behaves the same, and a hypothesis property checks the frames
38
+ match.
39
+ - **Round trips.** Formulas, number formats, merged cells, column widths, frozen panes
40
+ and defined names all survive xlsx → zarr → xlsx.
41
+ - **Any zarr store.** Local, `s3://`, in memory, a `ZipStore`, or an Icechunk session.
42
+ - **In-place edits.** `wb["Inputs"]["B2"] = 42` rewrites the one shard that cell is in.
43
+
44
+ ## Is it fast?
45
+
46
+ On a 50,000 × 20 sheet ([details](docs/guide/benchmarks.md)):
47
+
48
+ | read | seconds |
49
+ |---|---:|
50
+ | `pd.read_excel` (openpyxl) | 2.97 |
51
+ | `pd.read_excel` (calamine) | 0.63 |
52
+ | `pd.read_hdf` | **0.017** |
53
+ | `xz.read_excel` | 0.22 |
54
+ | 100-cell range read | **0.004** |
55
+
56
+ So HDF is still the right call for "the whole sheet as a DataFrame, fast". excelizarr
57
+ is 14× faster than parsing the `.xlsx`, smaller on disk than either, and much better
58
+ at the cloud-shaped jobs: range reads, partial access and version control.
59
+
60
+ From S3 (`ap-southeast-2`, from Australia), on a 500,000 × 20 sheet
61
+ ([details](docs/guide/cloud.md#whole-sheets)):
62
+
63
+ | read | seconds |
64
+ |---|---:|
65
+ | `pd.read_excel` (openpyxl) | 34.76 |
66
+ | `pd.read_excel` (calamine) | 8.26 |
67
+ | download + `pd.read_hdf` | **1.99** |
68
+ | `xz.read_excel` | 2.96 |
69
+ | open + 100-cell range read | **0.48** |
70
+
71
+ The range read costs the same at 10,000 rows as at 500,000: it only ever fetches the
72
+ chunks it needs.
73
+
74
+ ## Development
75
+
76
+ ```bash
77
+ pixi run test # hypothesis-heavy test suite
78
+ pixi run -e docs docs # executed MyST docs, warnings are errors
79
+ pixi run -e bench bench # the benchmark above
80
+ ```
81
+
82
+ ## Licence
83
+
84
+ [The Not Fit For Purpose Licence](LICENSE), which is the Apache License 2.0 with a
85
+ preamble. This tool is not fit for purpose. I don't care what your purpose is, this
86
+ isn't it.
@@ -0,0 +1,207 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "versioneer[toml]==0.29"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+
6
+ [project]
7
+ name = "excelizarr"
8
+ description = "A cloud-native representation of an .xlsx workbook, in Zarr. Yes, really."
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ authors = [{ name = "Charles Turner", email = "charles.turner@anu.edu.au" }]
12
+ maintainers = [{ name = "Charles Turner", email = "charles.turner@anu.edu.au" }]
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: Apache Software License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ license = { text = "Apache Software License 2.0" }
20
+ dependencies = [
21
+ "numpy",
22
+ "openpyxl", # the full-fidelity reader and the only writer: formulas, formats, merges
23
+ "pandas",
24
+ "zarr>=3.3", # Store.get_ranges: shard reads coalesce
25
+ ]
26
+
27
+ dynamic = ["version"]
28
+
29
+ [project.optional-dependencies]
30
+ # The calamine-backed reader (cell-level types, unlike fastexcel's column-typed Arrow):
31
+ fast = ["python-calamine"]
32
+ # Version-controlled spreadsheets. Any zarr store works; this just makes it fun.
33
+ icechunk = ["icechunk"]
34
+ dev = [
35
+ "black", # formatting
36
+ "coverage", # testing
37
+ "hypothesis", # testing (property-based)
38
+ "mypy", # linting
39
+ "pytest", # testing
40
+ "ruff", # linting
41
+ ]
42
+ # Declared once, consumed twice: pixi exposes every optional-dependency group as a
43
+ # feature of the same name, and Read the Docs installs ``.[docs]`` with pip.
44
+ docs = [
45
+ "sphinx>=8",
46
+ "myst-nb>=1.2", # MyST pages *and* executed code cells; it bundles myst-parser
47
+ "pydata-sphinx-theme>=0.16",
48
+ "sphinx-design",
49
+ "sphinx-copybutton",
50
+ "ipykernel", # myst-nb executes pages through a Jupyter kernel
51
+ "icechunk", # the version-control page is executed
52
+ ]
53
+
54
+ [project.urls]
55
+ bugs = "https://github.com/charles-turner-1/excelizarr/issues"
56
+ homepage = "https://github.com/charles-turner-1/excelizarr"
57
+
58
+ [tool.setuptools]
59
+ package-dir = { "" = "src" }
60
+
61
+ [tool.setuptools.package-data]
62
+ "*" = ["*.*"]
63
+
64
+
65
+ # Mypy
66
+ # ----
67
+
68
+ [tool.mypy]
69
+ files = "src"
70
+ exclude = ["src/excelizarr/_version.py"]
71
+ strict = true
72
+ warn_unreachable = true
73
+ warn_no_return = true
74
+ allow_subclassing_any = true
75
+
76
+ [[tool.mypy.overrides]]
77
+ # versioneer-generated. ``exclude`` keeps it out of ``mypy`` runs that discover files,
78
+ # but pre-commit passes ``src`` explicitly, which bypasses ``exclude``.
79
+ module = ["excelizarr._version"]
80
+ ignore_errors = true
81
+
82
+ [[tool.mypy.overrides]]
83
+ # Neither ships type information.
84
+ module = ["openpyxl.*", "python_calamine.*"]
85
+ ignore_missing_imports = true
86
+
87
+ [tool.versioneer]
88
+ VCS = "git"
89
+ style = "pep440"
90
+ versionfile_source = "src/excelizarr/_version.py"
91
+ versionfile_build = "excelizarr/_version.py"
92
+ tag_prefix = "v"
93
+ parentdir_prefix = "excelizarr-"
94
+
95
+ [tool.coverage.run]
96
+ omit = ["*/_version.py"]
97
+
98
+ [tool.ruff]
99
+ target-version = "py312"
100
+ exclude = [".git", ".mypy_cache", ".ruff_cache", ".venv", ".pixi", "_build", "build", "dist", "versioneer.py", "_version.py", "tests"]
101
+
102
+ [tool.ruff.lint]
103
+ # E402: module level import not at top of file
104
+ # E501: line too long - let black worry about that
105
+ # D105: magic methods carry their meaning in the name
106
+ # D205: black owns the wrapping of multi-sentence summaries
107
+ ignore = ["E402", "E501", "D105", "D205"]
108
+ select = ["F", "E", "W", "I", "UP", "D"]
109
+
110
+ [tool.ruff.lint.per-file-ignores]
111
+ "tests/**" = ["D401"]
112
+
113
+ [tool.ruff.lint.pydocstyle]
114
+ convention = "numpy"
115
+
116
+ [tool.ruff.lint.isort]
117
+ known-first-party = ["excelizarr"]
118
+
119
+ [tool.pytest.ini_options]
120
+ addopts = "--hypothesis-show-statistics"
121
+
122
+
123
+ # Pixi
124
+ # ----
125
+
126
+ [tool.pixi.workspace]
127
+ channels = ["conda-forge"]
128
+ name = "excelizarr"
129
+ platforms = ["osx-arm64", "linux-64", "win-64"]
130
+
131
+ [tool.pixi.dependencies]
132
+ python = ">=3.12"
133
+ numpy = "*"
134
+ openpyxl = "*"
135
+ pandas = "*"
136
+ zarr = ">=3.3"
137
+ versioneer = ">=0.29,<0.30"
138
+ setuptools = ">=64"
139
+
140
+ [tool.pixi.pypi-dependencies]
141
+ excelizarr = { editable = true, path = "." }
142
+
143
+ [tool.pixi.environments]
144
+ default = { features = ["dev", "test", "fast", "icechunk"], solve-group = "default" }
145
+ test-py312 = { features = ["py312", "test", "fast", "icechunk"] }
146
+ test-py313 = { features = ["py313", "test", "fast", "icechunk"] }
147
+ # The bare arm: no fastexcel, no icechunk. Their tests ``importorskip``, and this is the
148
+ # environment that proves excelizarr itself never needs either.
149
+ test-minimal = { features = ["test"] }
150
+ docs = { features = ["docs", "fast"], solve-group = "default" }
151
+ # Only the benchmark script needs these: the HDF comparison is the whole point of it.
152
+ bench = { features = ["bench", "fast"], solve-group = "default" }
153
+
154
+ [tool.pixi.feature.fast.dependencies]
155
+ python-calamine = "*"
156
+
157
+ [tool.pixi.feature.icechunk.dependencies]
158
+ icechunk = "*"
159
+
160
+ [tool.pixi.feature.test.dependencies]
161
+ pytest = ">=8.4.2"
162
+ coverage = "*"
163
+ hypothesis = "*"
164
+
165
+ [tool.pixi.feature.test.tasks]
166
+ test = { cmd = "pytest tests", description = "Run tests" }
167
+ test-cov = { cmd = "coverage run -m --source=excelizarr pytest tests && coverage xml", description = "Run tests with coverage and generate xml report" }
168
+
169
+ [tool.pixi.feature.dev.dependencies]
170
+ pre-commit = ">=4.2.0,<5"
171
+ ruff = "*"
172
+ black = "*"
173
+ mypy = "*"
174
+ pandas-stubs = "*"
175
+
176
+ [tool.pixi.feature.dev.tasks]
177
+ ruff = { cmd = "ruff check src", description = "Run ruff checks" }
178
+ black = { cmd = "black src tests benchmarks", description = "Run the black formatter" }
179
+ mypy = { cmd = "mypy", description = "Run mypy type checks (config: [tool.mypy])" }
180
+ pre-commit = { cmd = "pre-commit run --all-files", description = "Run pre-commit hooks" }
181
+ pre-commit-install = { cmd = "pre-commit install", description = "Install pre-commit hooks" }
182
+
183
+ [tool.pixi.feature.docs.tasks]
184
+ docs = { cmd = "sphinx-build -W --keep-going -b html docs docs/_build/html", description = "Build the docs (warnings are errors)" }
185
+
186
+ [tool.pixi.feature.bench.dependencies]
187
+ pytables = "*"
188
+
189
+ [tool.pixi.feature.bench.tasks]
190
+ bench = { cmd = "python benchmarks/bench_read.py", description = "Time xlsx vs HDF vs Zarr reads" }
191
+
192
+ [tool.pixi.feature.py312.dependencies]
193
+ python = "3.12.*"
194
+
195
+ [tool.pixi.feature.py313.dependencies]
196
+ python = "3.13.*"
197
+
198
+ [tool.numpydoc_validation]
199
+ checks = [
200
+ "PR01", "PR02", "PR03", "PR04", "PR05", "PR06", "PR07",
201
+ "RT01", "RT03", "RT04",
202
+ "GL02", "GL03",
203
+ "YD01",
204
+ ]
205
+ # Single-underscore helpers are private and documented as much as they need, which is
206
+ # often one line. Dunders still validate: ``__getitem__``/``__setitem__`` are API here.
207
+ exclude = ['\._[a-z]\w*$']
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,11 @@
1
+ # type: ignore
2
+ """Shim so versioneer can supply the version; the real metadata is in pyproject.toml."""
3
+
4
+ from setuptools import setup
5
+
6
+ import versioneer
7
+
8
+ setup(
9
+ version=versioneer.get_version(),
10
+ cmdclass=versioneer.get_cmdclass(),
11
+ )