betteroffice-xlsx 0.0.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.
- betteroffice_xlsx-0.0.1/Cargo.toml +52 -0
- betteroffice_xlsx-0.0.1/LICENSE +201 -0
- betteroffice_xlsx-0.0.1/NOTICE +2 -0
- betteroffice_xlsx-0.0.1/PKG-INFO +175 -0
- betteroffice_xlsx-0.0.1/README.md +146 -0
- betteroffice_xlsx-0.0.1/THIRD-PARTY-NOTICES.md +21 -0
- betteroffice_xlsx-0.0.1/bindings/python/Cargo.lock +940 -0
- betteroffice_xlsx-0.0.1/bindings/python/Cargo.toml +24 -0
- betteroffice_xlsx-0.0.1/bindings/python/LICENSE +201 -0
- betteroffice_xlsx-0.0.1/bindings/python/NOTICE +2 -0
- betteroffice_xlsx-0.0.1/bindings/python/README.md +146 -0
- betteroffice_xlsx-0.0.1/bindings/python/THIRD-PARTY-NOTICES.md +21 -0
- betteroffice_xlsx-0.0.1/bindings/python/licenses/Carlito-OFL.txt +94 -0
- betteroffice_xlsx-0.0.1/bindings/python/src/lib.rs +404 -0
- betteroffice_xlsx-0.0.1/bindings/python/tests/conftest.py +18 -0
- betteroffice_xlsx-0.0.1/bindings/python/tests/test_workbook.py +353 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/Cargo.toml +29 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/README.md +77 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/src/authority.rs +3212 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/src/error.rs +163 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/src/lib.rs +34 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/src/types.rs +176 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/src/workbook.rs +2363 -0
- betteroffice_xlsx-0.0.1/crates/betteroffice-xlsx/tests/workbook.rs +2720 -0
- betteroffice_xlsx-0.0.1/crates/ooxml-opc/Cargo.toml +29 -0
- betteroffice_xlsx-0.0.1/crates/ooxml-opc/README.md +27 -0
- betteroffice_xlsx-0.0.1/crates/ooxml-opc/src/lib.rs +266 -0
- betteroffice_xlsx-0.0.1/crates/ooxml-opc/src/sanitize.rs +640 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/Cargo.toml +18 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/README.md +164 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/examples/demo.rs +66 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/deps.rs +107 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/engine.rs +621 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/eval.rs +932 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/criteria.rs +315 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/datetime.rs +351 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/info.rs +80 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/logical.rs +161 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/lookups.rs +310 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/math.rs +349 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/mod.rs +198 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/stats.rs +378 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/functions/text.rs +571 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/graph.rs +563 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/lexer.rs +548 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/lib.rs +28 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/parser.rs +466 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/src/printer.rs +169 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/tests/eval_fixtures.rs +155 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-calc/tests/functions.rs +290 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/Cargo.toml +18 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/README.md +22 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/addr.rs +235 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/date.rs +57 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/lib.rs +18 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/numfmt/tests.rs +339 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/numfmt.rs +1174 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/styles.rs +626 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/value.rs +58 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-model/src/workbook.rs +359 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/Cargo.toml +23 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/README.md +22 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/apply.rs +1293 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/formatting.rs +390 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/input.rs +227 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/lib.rs +20 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/op.rs +197 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/proposals.rs +162 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/remap.rs +872 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/src/undo.rs +184 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-ops/tests/integration.rs +272 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/Cargo.toml +19 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/README.md +23 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/lib.rs +73 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/read.rs +571 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/styles.rs +368 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/tests.rs +627 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/write.rs +955 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-parse/src/xml.rs +126 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/Cargo.toml +21 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/README.md +20 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/assets/Carlito-Regular.ttf +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/assets/OFL.txt +94 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/assets/README.md +20 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/src/font.rs +313 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/src/lib.rs +257 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden/align.png +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden/clipped.png +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden/mixed.png +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden/styled.png +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden/unicode.png +0 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-raster/tests/golden.rs +253 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/Cargo.toml +19 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/README.md +28 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/src/display_list.rs +325 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/src/geometry.rs +218 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/src/lib.rs +1518 -0
- betteroffice_xlsx-0.0.1/crates/xlsx-render/src/region.rs +100 -0
- betteroffice_xlsx-0.0.1/licenses/Carlito-OFL.txt +94 -0
- betteroffice_xlsx-0.0.1/pyproject.toml +57 -0
- betteroffice_xlsx-0.0.1/python/betteroffice_xlsx/__init__.py +219 -0
- betteroffice_xlsx-0.0.1/python/betteroffice_xlsx/_betteroffice_xlsx.pyi +76 -0
- betteroffice_xlsx-0.0.1/python/betteroffice_xlsx/py.typed +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
members = ["crates/*"]
|
|
3
|
+
resolver = "3"
|
|
4
|
+
|
|
5
|
+
[workspace.package]
|
|
6
|
+
version = "0.0.4"
|
|
7
|
+
edition = "2024"
|
|
8
|
+
license = "Apache-2.0"
|
|
9
|
+
homepage = "https://betteroffice.dev"
|
|
10
|
+
repository = "https://github.com/openooxml/betteroffice"
|
|
11
|
+
|
|
12
|
+
[workspace.dependencies]
|
|
13
|
+
betteroffice-xlsx = { path = "crates/betteroffice-xlsx", version = "0.0.4", default-features = false }
|
|
14
|
+
ooxml-opc = { package = "betteroffice-opc", path = "crates/ooxml-opc", version = "0.0.4" }
|
|
15
|
+
xlsx-model = { package = "betteroffice-xlsx-model", path = "crates/xlsx-model", version = "0.0.4" }
|
|
16
|
+
xlsx-parse = { package = "betteroffice-xlsx-parse", path = "crates/xlsx-parse", version = "0.0.4" }
|
|
17
|
+
xlsx-calc = { package = "betteroffice-xlsx-calc", path = "crates/xlsx-calc", version = "0.0.4" }
|
|
18
|
+
xlsx-ops = { package = "betteroffice-xlsx-ops", path = "crates/xlsx-ops", version = "0.0.4" }
|
|
19
|
+
xlsx-render = { package = "betteroffice-xlsx-render", path = "crates/xlsx-render", version = "0.0.4" }
|
|
20
|
+
xlsx-raster = { package = "betteroffice-xlsx-raster", path = "crates/xlsx-raster", version = "0.0.4" }
|
|
21
|
+
ooxml-text = { package = "betteroffice-ooxml-text", path = "crates/ooxml-text", version = "0.0.4" }
|
|
22
|
+
ooxml-drawingml = { package = "betteroffice-drawingml", path = "crates/ooxml-drawingml", version = "0.0.4" }
|
|
23
|
+
docx-parse = { package = "betteroffice-docx-parse", path = "crates/docx-parse", version = "0.0.4" }
|
|
24
|
+
docx-layout = { package = "betteroffice-docx-layout", path = "crates/docx-layout", version = "0.0.4" }
|
|
25
|
+
docx-edit = { package = "betteroffice-docx-edit", path = "crates/docx-edit", version = "0.0.4" }
|
|
26
|
+
betteroffice-docx = { path = "crates/betteroffice-docx", version = "0.0.4" }
|
|
27
|
+
pptx-parse = { package = "betteroffice-pptx-parse", path = "crates/pptx-parse", version = "0.0.4" }
|
|
28
|
+
pptx-edit = { package = "betteroffice-pptx-edit", path = "crates/pptx-edit", version = "0.0.4" }
|
|
29
|
+
pptx-render = { package = "betteroffice-pptx-render", path = "crates/pptx-render", version = "0.0.4" }
|
|
30
|
+
betteroffice-pptx = { path = "crates/betteroffice-pptx", version = "0.0.4" }
|
|
31
|
+
|
|
32
|
+
[profile.release]
|
|
33
|
+
opt-level = "s"
|
|
34
|
+
lto = true
|
|
35
|
+
|
|
36
|
+
[profile.release.package.betteroffice-docx-layout]
|
|
37
|
+
opt-level = 3
|
|
38
|
+
|
|
39
|
+
[profile.release.package.betteroffice-docx-parse]
|
|
40
|
+
opt-level = 3
|
|
41
|
+
|
|
42
|
+
# The per-keystroke hot path lives in docx-edit (engine session, frame
|
|
43
|
+
# encoding), ooxml-text (shaping/measurement), and yrs (text CRDT ops); the
|
|
44
|
+
# size-optimized workspace default measurably slows all three.
|
|
45
|
+
[profile.release.package.betteroffice-docx-edit]
|
|
46
|
+
opt-level = 3
|
|
47
|
+
|
|
48
|
+
[profile.release.package.betteroffice-ooxml-text]
|
|
49
|
+
opt-level = 3
|
|
50
|
+
|
|
51
|
+
[profile.release.package.yrs]
|
|
52
|
+
opt-level = 3
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Elia Hilse, The OpenOOXML Project
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: betteroffice-xlsx
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
|
+
Classifier: Programming Language :: Rust
|
|
10
|
+
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
License-File: THIRD-PARTY-NOTICES.md
|
|
16
|
+
License-File: licenses/Carlito-OFL.txt
|
|
17
|
+
Summary: Read, recalculate, render, and write XLSX workbooks. Rust engine, no Excel and no LibreOffice.
|
|
18
|
+
Keywords: xlsx,excel,spreadsheet,ooxml,formula,recalculate,render,openpyxl-alternative,rust
|
|
19
|
+
Home-Page: https://betteroffice.dev
|
|
20
|
+
Author: OpenOOXML
|
|
21
|
+
License-Expression: Apache-2.0
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
24
|
+
Project-URL: Documentation, https://docs.betteroffice.dev
|
|
25
|
+
Project-URL: Homepage, https://betteroffice.dev
|
|
26
|
+
Project-URL: Issues, https://github.com/openooxml/betteroffice/issues
|
|
27
|
+
Project-URL: Source, https://github.com/openooxml/betteroffice
|
|
28
|
+
|
|
29
|
+
# betteroffice-xlsx
|
|
30
|
+
|
|
31
|
+
Read, recalculate, render, and write XLSX workbooks from Python. The engine is
|
|
32
|
+
the Rust [BetterOffice](https://betteroffice.dev) XLSX core, compiled into the
|
|
33
|
+
wheel — no Excel, no LibreOffice subprocess, no COM.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install betteroffice-xlsx
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Formulas actually calculate
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from betteroffice_xlsx import Workbook
|
|
43
|
+
|
|
44
|
+
wb = Workbook.open_path("budget.xlsx")
|
|
45
|
+
|
|
46
|
+
sheet = wb["Sheet1"]
|
|
47
|
+
sheet["B1"] = 10
|
|
48
|
+
sheet["B2"] = 32
|
|
49
|
+
sheet["B3"] = "=SUM(B1:B2)"
|
|
50
|
+
|
|
51
|
+
print(sheet["B3"]) # 42.0 <- computed here, not read from a cache
|
|
52
|
+
print(sheet.formula("B3")) # 'SUM(B1:B2)'
|
|
53
|
+
|
|
54
|
+
wb.save_path("budget-out.xlsx")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Value and formula are separate accessors on purpose: `sheet["B3"]` is the value,
|
|
58
|
+
`sheet.formula("B3")` is the source text. Writing a cell recalculates its
|
|
59
|
+
dependents, so the value above is computed here rather than read back from the
|
|
60
|
+
file.
|
|
61
|
+
|
|
62
|
+
`Workbook.open` starts from the values the authoring application cached, and a
|
|
63
|
+
cell you have not touched keeps that cached value — including if it was stale
|
|
64
|
+
when the file was written. Use `open_recalculated`, or call `recalculate()`,
|
|
65
|
+
when you need every formula evaluated by this engine rather than trusted from
|
|
66
|
+
the file.
|
|
67
|
+
|
|
68
|
+
## Render a sheet to PNG
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
png = wb.render_png("Sheet1", scale=2.0, range="A1:H40")
|
|
72
|
+
png.write("preview.png")
|
|
73
|
+
print(png.width, png.height)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Rendering is the same grid layout and display list the browser editor uses, so
|
|
77
|
+
server-side output matches what the web canvas paints.
|
|
78
|
+
|
|
79
|
+
Opening, recalculating, rendering, and saving release the GIL, so they run in
|
|
80
|
+
parallel across threads instead of serializing your workers.
|
|
81
|
+
|
|
82
|
+
## Reading without recalculating
|
|
83
|
+
|
|
84
|
+
`Workbook.open` keeps whatever values the file already carried. Use
|
|
85
|
+
`open_recalculated` to evaluate everything up front, or call `recalculate()`
|
|
86
|
+
later:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
wb = Workbook.open_recalculated(open("report.xlsx", "rb").read())
|
|
90
|
+
|
|
91
|
+
summary = wb.recalculate()
|
|
92
|
+
print(summary.changed, summary.cycles)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Compared with openpyxl
|
|
96
|
+
|
|
97
|
+
| | `openpyxl` | `betteroffice-xlsx` |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Read cell values | yes | yes |
|
|
100
|
+
| Evaluate formulas | no — returns the formula string, or a stale cached value | yes |
|
|
101
|
+
| Render to an image | no | yes, PNG |
|
|
102
|
+
| Engine | pure Python | Rust, compiled |
|
|
103
|
+
|
|
104
|
+
`openpyxl` is a far broader library and covers plenty this does not. If you need
|
|
105
|
+
formulas evaluated or a sheet rasterized, that is the gap this fills.
|
|
106
|
+
|
|
107
|
+
## API
|
|
108
|
+
|
|
109
|
+
| | |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `Workbook.open(data)` | open from `bytes` |
|
|
112
|
+
| `Workbook.open_path(path)` | open from a path |
|
|
113
|
+
| `Workbook.open_recalculated(data)` | open and evaluate every formula |
|
|
114
|
+
| `wb.recalculate()` | re-evaluate; returns a `Calculation` summary |
|
|
115
|
+
| `wb.sheet_names` / `wb.sheet_count` | sheet metadata |
|
|
116
|
+
| `wb[key]` / `wb.sheet(key)` | a `Sheet` by name or index |
|
|
117
|
+
| `sheet[addr]` | cell value — see the note below on when it is recalculated |
|
|
118
|
+
| `sheet[addr] = value` | set from what a user would type |
|
|
119
|
+
| `sheet.formula(addr)` | source formula, or `None` |
|
|
120
|
+
| `wb.render_png(sheet, ...)` | render to PNG |
|
|
121
|
+
| `wb.save()` / `wb.save_path(path)` | serialize to XLSX |
|
|
122
|
+
|
|
123
|
+
Cell values come back as `None`, `float`, `str`, `bool`, or `CellError`.
|
|
124
|
+
Numbers are `f64` in the engine, so they arrive as `float` and are not narrowed
|
|
125
|
+
to `int`. Errors are a `CellError` instance rather than a string, so `#DIV/0!`
|
|
126
|
+
as a value is distinguishable from a cell containing that text. `CellError`
|
|
127
|
+
compares equal to its code, and hashes like it, so it works as a dict key:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
if sheet["D3"] == "#DIV/0!":
|
|
131
|
+
...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Writing accepts `None` (clears the cell), `bool`, `int`, `float`, `Decimal`, and
|
|
135
|
+
`str`. `date`, `datetime`, `time`, and `timedelta` raise `TypeError` for now:
|
|
136
|
+
converting them needs the workbook's date system, which is not exposed yet, and
|
|
137
|
+
stringifying them would write text that only looks like a date. Pass the Excel
|
|
138
|
+
serial number as a float if you need a date today.
|
|
139
|
+
|
|
140
|
+
Strings are interpreted the way Excel interprets typed input: a leading `=` is a
|
|
141
|
+
formula, `TRUE`/`FALSE` become booleans, and numeric text becomes a number.
|
|
142
|
+
Prefix with an apostrophe to force text.
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
sheet["A1"] = "'=1+1" # the text "=1+1"
|
|
146
|
+
sheet["A2"] = "=1+1" # the formula, evaluating to 2.0
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Errors raise `XlsxError`, or one of `ParseError`, `RangeError`, `RenderError`.
|
|
150
|
+
|
|
151
|
+
## Status
|
|
152
|
+
|
|
153
|
+
`0.0.x`, and the API may change before `0.1.0`. `save` regenerates the package
|
|
154
|
+
from the features the model represents; package parts the model does not cover
|
|
155
|
+
are not retained, so this is not a round-trip-preserving editor for arbitrary
|
|
156
|
+
workbooks. Collaboration, agent proposals, undo/redo, and the styling APIs exist
|
|
157
|
+
in the Rust engine but are not yet exposed here.
|
|
158
|
+
|
|
159
|
+
Wheels are built for Linux (x86_64, aarch64), macOS (arm64, x86_64), and Windows
|
|
160
|
+
(x86_64) against the stable ABI for CPython 3.9 and up.
|
|
161
|
+
|
|
162
|
+
The extension embeds Carlito, a Calibri-metric-compatible face used to measure
|
|
163
|
+
and draw cell text, under the SIL Open Font License. Its license travels with
|
|
164
|
+
the wheel — see `THIRD-PARTY-NOTICES.md` and `licenses/Carlito-OFL.txt`. The
|
|
165
|
+
package's own code is Apache-2.0.
|
|
166
|
+
|
|
167
|
+
## Links
|
|
168
|
+
|
|
169
|
+
- [BetterOffice](https://betteroffice.dev) — the project
|
|
170
|
+
- [Documentation](https://docs.betteroffice.dev)
|
|
171
|
+
- [Source](https://github.com/openooxml/betteroffice) — `bindings/python`
|
|
172
|
+
- [betteroffice-xlsx on crates.io](https://crates.io/crates/betteroffice-xlsx) — the engine this wraps
|
|
173
|
+
|
|
174
|
+
Apache-2.0.
|
|
175
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# betteroffice-xlsx
|
|
2
|
+
|
|
3
|
+
Read, recalculate, render, and write XLSX workbooks from Python. The engine is
|
|
4
|
+
the Rust [BetterOffice](https://betteroffice.dev) XLSX core, compiled into the
|
|
5
|
+
wheel — no Excel, no LibreOffice subprocess, no COM.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install betteroffice-xlsx
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Formulas actually calculate
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from betteroffice_xlsx import Workbook
|
|
15
|
+
|
|
16
|
+
wb = Workbook.open_path("budget.xlsx")
|
|
17
|
+
|
|
18
|
+
sheet = wb["Sheet1"]
|
|
19
|
+
sheet["B1"] = 10
|
|
20
|
+
sheet["B2"] = 32
|
|
21
|
+
sheet["B3"] = "=SUM(B1:B2)"
|
|
22
|
+
|
|
23
|
+
print(sheet["B3"]) # 42.0 <- computed here, not read from a cache
|
|
24
|
+
print(sheet.formula("B3")) # 'SUM(B1:B2)'
|
|
25
|
+
|
|
26
|
+
wb.save_path("budget-out.xlsx")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Value and formula are separate accessors on purpose: `sheet["B3"]` is the value,
|
|
30
|
+
`sheet.formula("B3")` is the source text. Writing a cell recalculates its
|
|
31
|
+
dependents, so the value above is computed here rather than read back from the
|
|
32
|
+
file.
|
|
33
|
+
|
|
34
|
+
`Workbook.open` starts from the values the authoring application cached, and a
|
|
35
|
+
cell you have not touched keeps that cached value — including if it was stale
|
|
36
|
+
when the file was written. Use `open_recalculated`, or call `recalculate()`,
|
|
37
|
+
when you need every formula evaluated by this engine rather than trusted from
|
|
38
|
+
the file.
|
|
39
|
+
|
|
40
|
+
## Render a sheet to PNG
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
png = wb.render_png("Sheet1", scale=2.0, range="A1:H40")
|
|
44
|
+
png.write("preview.png")
|
|
45
|
+
print(png.width, png.height)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Rendering is the same grid layout and display list the browser editor uses, so
|
|
49
|
+
server-side output matches what the web canvas paints.
|
|
50
|
+
|
|
51
|
+
Opening, recalculating, rendering, and saving release the GIL, so they run in
|
|
52
|
+
parallel across threads instead of serializing your workers.
|
|
53
|
+
|
|
54
|
+
## Reading without recalculating
|
|
55
|
+
|
|
56
|
+
`Workbook.open` keeps whatever values the file already carried. Use
|
|
57
|
+
`open_recalculated` to evaluate everything up front, or call `recalculate()`
|
|
58
|
+
later:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
wb = Workbook.open_recalculated(open("report.xlsx", "rb").read())
|
|
62
|
+
|
|
63
|
+
summary = wb.recalculate()
|
|
64
|
+
print(summary.changed, summary.cycles)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Compared with openpyxl
|
|
68
|
+
|
|
69
|
+
| | `openpyxl` | `betteroffice-xlsx` |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| Read cell values | yes | yes |
|
|
72
|
+
| Evaluate formulas | no — returns the formula string, or a stale cached value | yes |
|
|
73
|
+
| Render to an image | no | yes, PNG |
|
|
74
|
+
| Engine | pure Python | Rust, compiled |
|
|
75
|
+
|
|
76
|
+
`openpyxl` is a far broader library and covers plenty this does not. If you need
|
|
77
|
+
formulas evaluated or a sheet rasterized, that is the gap this fills.
|
|
78
|
+
|
|
79
|
+
## API
|
|
80
|
+
|
|
81
|
+
| | |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `Workbook.open(data)` | open from `bytes` |
|
|
84
|
+
| `Workbook.open_path(path)` | open from a path |
|
|
85
|
+
| `Workbook.open_recalculated(data)` | open and evaluate every formula |
|
|
86
|
+
| `wb.recalculate()` | re-evaluate; returns a `Calculation` summary |
|
|
87
|
+
| `wb.sheet_names` / `wb.sheet_count` | sheet metadata |
|
|
88
|
+
| `wb[key]` / `wb.sheet(key)` | a `Sheet` by name or index |
|
|
89
|
+
| `sheet[addr]` | cell value — see the note below on when it is recalculated |
|
|
90
|
+
| `sheet[addr] = value` | set from what a user would type |
|
|
91
|
+
| `sheet.formula(addr)` | source formula, or `None` |
|
|
92
|
+
| `wb.render_png(sheet, ...)` | render to PNG |
|
|
93
|
+
| `wb.save()` / `wb.save_path(path)` | serialize to XLSX |
|
|
94
|
+
|
|
95
|
+
Cell values come back as `None`, `float`, `str`, `bool`, or `CellError`.
|
|
96
|
+
Numbers are `f64` in the engine, so they arrive as `float` and are not narrowed
|
|
97
|
+
to `int`. Errors are a `CellError` instance rather than a string, so `#DIV/0!`
|
|
98
|
+
as a value is distinguishable from a cell containing that text. `CellError`
|
|
99
|
+
compares equal to its code, and hashes like it, so it works as a dict key:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
if sheet["D3"] == "#DIV/0!":
|
|
103
|
+
...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Writing accepts `None` (clears the cell), `bool`, `int`, `float`, `Decimal`, and
|
|
107
|
+
`str`. `date`, `datetime`, `time`, and `timedelta` raise `TypeError` for now:
|
|
108
|
+
converting them needs the workbook's date system, which is not exposed yet, and
|
|
109
|
+
stringifying them would write text that only looks like a date. Pass the Excel
|
|
110
|
+
serial number as a float if you need a date today.
|
|
111
|
+
|
|
112
|
+
Strings are interpreted the way Excel interprets typed input: a leading `=` is a
|
|
113
|
+
formula, `TRUE`/`FALSE` become booleans, and numeric text becomes a number.
|
|
114
|
+
Prefix with an apostrophe to force text.
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
sheet["A1"] = "'=1+1" # the text "=1+1"
|
|
118
|
+
sheet["A2"] = "=1+1" # the formula, evaluating to 2.0
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Errors raise `XlsxError`, or one of `ParseError`, `RangeError`, `RenderError`.
|
|
122
|
+
|
|
123
|
+
## Status
|
|
124
|
+
|
|
125
|
+
`0.0.x`, and the API may change before `0.1.0`. `save` regenerates the package
|
|
126
|
+
from the features the model represents; package parts the model does not cover
|
|
127
|
+
are not retained, so this is not a round-trip-preserving editor for arbitrary
|
|
128
|
+
workbooks. Collaboration, agent proposals, undo/redo, and the styling APIs exist
|
|
129
|
+
in the Rust engine but are not yet exposed here.
|
|
130
|
+
|
|
131
|
+
Wheels are built for Linux (x86_64, aarch64), macOS (arm64, x86_64), and Windows
|
|
132
|
+
(x86_64) against the stable ABI for CPython 3.9 and up.
|
|
133
|
+
|
|
134
|
+
The extension embeds Carlito, a Calibri-metric-compatible face used to measure
|
|
135
|
+
and draw cell text, under the SIL Open Font License. Its license travels with
|
|
136
|
+
the wheel — see `THIRD-PARTY-NOTICES.md` and `licenses/Carlito-OFL.txt`. The
|
|
137
|
+
package's own code is Apache-2.0.
|
|
138
|
+
|
|
139
|
+
## Links
|
|
140
|
+
|
|
141
|
+
- [BetterOffice](https://betteroffice.dev) — the project
|
|
142
|
+
- [Documentation](https://docs.betteroffice.dev)
|
|
143
|
+
- [Source](https://github.com/openooxml/betteroffice) — `bindings/python`
|
|
144
|
+
- [betteroffice-xlsx on crates.io](https://crates.io/crates/betteroffice-xlsx) — the engine this wraps
|
|
145
|
+
|
|
146
|
+
Apache-2.0.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
This wheel embeds third-party material in the compiled extension module. The
|
|
4
|
+
package itself is Apache-2.0; the notices below apply to the bundled material.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Carlito (metric-compatible with Calibri)
|
|
9
|
+
|
|
10
|
+
`Carlito-Regular.ttf` is vendored unmodified from the google/fonts repository,
|
|
11
|
+
`ofl/carlito` (https://github.com/google/fonts); upstream project
|
|
12
|
+
https://github.com/googlefonts/carlito. The bytes are compiled into the
|
|
13
|
+
`betteroffice-xlsx-raster` crate via `include_bytes!` and are therefore present
|
|
14
|
+
inside this wheel's extension module. The renderer uses the face to measure and
|
|
15
|
+
draw cell text.
|
|
16
|
+
|
|
17
|
+
Copyright 2013 The Carlito Project Authors, with Reserved Font Name "Carlito".
|
|
18
|
+
|
|
19
|
+
License: SIL Open Font License, Version 1.1 — the full text is distributed with
|
|
20
|
+
this package as `licenses/Carlito-OFL.txt`. The OFL applies to the font asset
|
|
21
|
+
only, not to this package's code.
|