excel-data-model-lab 0.5.0rc1__py3-none-any.whl

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 (76) hide show
  1. excel_data_model_lab-0.5.0rc1.dist-info/METADATA +432 -0
  2. excel_data_model_lab-0.5.0rc1.dist-info/RECORD +76 -0
  3. excel_data_model_lab-0.5.0rc1.dist-info/WHEEL +5 -0
  4. excel_data_model_lab-0.5.0rc1.dist-info/entry_points.txt +3 -0
  5. excel_data_model_lab-0.5.0rc1.dist-info/licenses/LICENSE +21 -0
  6. excel_data_model_lab-0.5.0rc1.dist-info/licenses/THIRD_PARTY_NOTICES.md +83 -0
  7. excel_data_model_lab-0.5.0rc1.dist-info/top_level.txt +2 -0
  8. excel_model_lab/__init__.py +96 -0
  9. excel_model_lab/abf.py +579 -0
  10. excel_model_lab/agent_workflow.py +420 -0
  11. excel_model_lab/calculated_columns.py +449 -0
  12. excel_model_lab/cli.py +220 -0
  13. excel_model_lab/collation.py +84 -0
  14. excel_model_lab/column_import.py +100 -0
  15. excel_model_lab/composition.py +80 -0
  16. excel_model_lab/cube_cache.py +98 -0
  17. excel_model_lab/cube_formulas.py +174 -0
  18. excel_model_lab/cube_source_view.py +189 -0
  19. excel_model_lab/data/authoring-seed.xlsx +0 -0
  20. excel_model_lab/data/empty-table.xml +1 -0
  21. excel_model_lab/data/hierarchy-index.xml +380 -0
  22. excel_model_lab/data/kpi-properties.xml +389 -0
  23. excel_model_lab/data/measure-diagram.xml +1 -0
  24. excel_model_lab/data/measure-grid.xml +1 -0
  25. excel_model_lab/data/nls-en-v1.bin.gz +0 -0
  26. excel_model_lab/data/nls-en-v1.json +29 -0
  27. excel_model_lab/data/nls-jamo-v1.json +1 -0
  28. excel_model_lab/data/relationship-index.xml +1 -0
  29. excel_model_lab/date_tables.py +166 -0
  30. excel_model_lab/dax_evaluation.py +316 -0
  31. excel_model_lab/dax_validation.py +401 -0
  32. excel_model_lab/dependencies.py +314 -0
  33. excel_model_lab/desktop_session.py +434 -0
  34. excel_model_lab/dictionary.py +143 -0
  35. excel_model_lab/empty_storage.py +202 -0
  36. excel_model_lab/errors.py +13 -0
  37. excel_model_lab/excel_metadata.py +148 -0
  38. excel_model_lab/external_connections.py +319 -0
  39. excel_model_lab/formula_statements.py +200 -0
  40. excel_model_lab/hash_index.py +82 -0
  41. excel_model_lab/hierarchy_storage.py +317 -0
  42. excel_model_lab/kpis.py +263 -0
  43. excel_model_lab/lookup.py +149 -0
  44. excel_model_lab/measure_edit.py +54 -0
  45. excel_model_lab/measure_layout.py +224 -0
  46. excel_model_lab/measures.py +100 -0
  47. excel_model_lab/metadata.py +256 -0
  48. excel_model_lab/model.py +2033 -0
  49. excel_model_lab/mutate.py +101 -0
  50. excel_model_lab/native_sources.py +286 -0
  51. excel_model_lab/null_dictionary.py +29 -0
  52. excel_model_lab/numeric_storage.py +291 -0
  53. excel_model_lab/ole_db.py +323 -0
  54. excel_model_lab/package.py +170 -0
  55. excel_model_lab/perspectives.py +369 -0
  56. excel_model_lab/portable_nls.py +160 -0
  57. excel_model_lab/preserve.py +128 -0
  58. excel_model_lab/reader.py +422 -0
  59. excel_model_lab/reader_adapter.py +96 -0
  60. excel_model_lab/relationship_storage.py +444 -0
  61. excel_model_lab/relationships.py +132 -0
  62. excel_model_lab/report_charts.py +191 -0
  63. excel_model_lab/report_editing.py +937 -0
  64. excel_model_lab/report_filters.py +229 -0
  65. excel_model_lab/report_package.py +375 -0
  66. excel_model_lab/report_slicers.py +346 -0
  67. excel_model_lab/reports.py +516 -0
  68. excel_model_lab/schema.py +689 -0
  69. excel_model_lab/sorting.py +101 -0
  70. excel_model_lab/source_crypto.py +46 -0
  71. excel_model_lab/sources.py +47 -0
  72. excel_model_lab/spec.py +176 -0
  73. excel_model_lab/structural_edit.py +254 -0
  74. excel_model_lab/validation.py +114 -0
  75. excel_model_lab/vertipaq.py +338 -0
  76. excelmodel/__init__.py +4 -0
@@ -0,0 +1,432 @@
1
+ Metadata-Version: 2.4
2
+ Name: excel-data-model-lab
3
+ Version: 0.5.0rc1
4
+ Summary: Headless template-based writer for embedded Excel Power Pivot models
5
+ License: MIT License
6
+
7
+ Copyright (c) 2026 excel-model-lab contributors
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Project-URL: Repository, https://github.com/sean-palmer-coding/excel-model-lab
28
+ Project-URL: Documentation, https://github.com/sean-palmer-coding/excel-model-lab#readme
29
+ Project-URL: Issues, https://github.com/sean-palmer-coding/excel-model-lab/issues
30
+ Requires-Python: >=3.10
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ License-File: THIRD_PARTY_NOTICES.md
34
+ Requires-Dist: pandas>=2.0
35
+ Requires-Dist: pbixray==0.15.5
36
+ Requires-Dist: PyYAML>=6.0
37
+ Provides-Extra: parquet
38
+ Requires-Dist: pyarrow>=14; extra == "parquet"
39
+ Provides-Extra: native-sources
40
+ Requires-Dist: cryptography>=43; extra == "native-sources"
41
+ Provides-Extra: workbooks
42
+ Requires-Dist: XlsxWriter<4,>=3.2; extra == "workbooks"
43
+ Provides-Extra: dax
44
+ Requires-Dist: pbix-mcp==0.9.153; extra == "dax"
45
+ Provides-Extra: external-query
46
+ Requires-Dist: pythonnet<4,>=3.0; extra == "external-query"
47
+ Provides-Extra: desktop
48
+ Requires-Dist: xlwings<0.34,>=0.33; extra == "desktop"
49
+ Dynamic: license-file
50
+
51
+ # Excel Data Model Lab
52
+
53
+ Python imports remain `excel_model_lab` and `excelmodel`. The distribution was
54
+ renamed from `excel-model-lab`; uninstall that older distribution before switching
55
+ to avoid overlapping package files.
56
+
57
+ Current release candidate: **0.5.0rc1**.
58
+
59
+ Install with `python -m pip install excel-data-model-lab==0.5.0rc1`.
60
+
61
+ Excel Data Model Lab is a headless Python writer for Excel's embedded Power Pivot /
62
+ Data Model. The writer does not require Excel, COM, Windows, or a remote model.
63
+ Desktop Excel is used separately to verify compatibility and by the optional
64
+ `desktop` extra for live workbook interaction.
65
+
66
+ The release includes model authoring and reading, model-backed PivotTables and
67
+ charts, workbook composition and CUBE helpers, bounded DAX evaluation, external
68
+ semantic connection/query adapters, and optional desktop/agent workflows.
69
+ Release verification: **864 passed, 50 expected skips** on local hardware; see
70
+ [publication acceptance](docs/publication-acceptance.md).
71
+ See [review acceptance](docs/review-fixes-acceptance.md) for local test and native
72
+ Excel evidence, and [Phase 7 acceptance](docs/phase7-live-acceptance.md) for SSAS
73
+ query and Excel refresh verification. Cloud authentication and external-model
74
+ PivotTable generation remain outside the verified scope. Historical CI results
75
+ in milestone reports apply to those checkpoints; this release is tested locally.
76
+
77
+ See [STATUS.md](STATUS.md) for current implementation limits and
78
+ [SPEC_AND_CLI.md](SPEC_AND_CLI.md) for JSON authoring and command-line validation.
79
+
80
+ The current source adds native Data Model PivotTables, PivotCharts, slicers and
81
+ date timelines, including controls connected to multiple reports. It supports
82
+ selected-member filters, label sorting, chart formatting, inspection, and
83
+ guarded edits/removal of saved reports and controls. Excel calculates and renders
84
+ the reports; Python does not require Excel to author them. Native tests verify
85
+ filtering and save/reopen, including connected controls and the combined example.
86
+ See the [report API guide](docs/phase2-reports.md),
87
+ [runnable example](examples/model_reports.py), and
88
+ [Phase 2 acceptance record](docs/phase2-acceptance.md) for verification evidence
89
+ and precise limits. On the tested Excel build, opening a fresh report or using
90
+ ordinary Refresh/Refresh All leaves its layout blank. Select the report's anchor
91
+ cell, check **Defer Layout Update** in **PivotTable Fields**, then click **Update**.
92
+ The optional [Windows helper](tools/update_model_reports.ps1) performs the tested
93
+ `PivotTable.Update()` action for all embedded-model reports and saves a separate
94
+ output. See the guide's first-use instructions; automatic rendering on open is
95
+ not guaranteed.
96
+
97
+ ## Install
98
+
99
+ ```bash
100
+ python -m pip install .
101
+ ```
102
+
103
+ ## Python API
104
+
105
+ ```python
106
+ from excelmodel import WorkbookModel
107
+
108
+ workbook = WorkbookModel.from_template("template.xlsx")
109
+ workbook.replace_tables({
110
+ "Claims": claims_df,
111
+ "Providers": providers_df,
112
+ })
113
+ workbook.add_relationship(
114
+ "Claims", "ProviderID", "Providers", "ProviderID"
115
+ )
116
+ workbook.add_measure(
117
+ "Claims",
118
+ "Total Charges",
119
+ "SUM('Claims'[ChargeAmount])",
120
+ format_string="$#,##0.00",
121
+ )
122
+ workbook.save("report.xlsx")
123
+ ```
124
+
125
+ Create a model without supplying a template:
126
+
127
+ ```python
128
+ from excel_model_lab import WorkbookModel
129
+
130
+ model = WorkbookModel.create({"Products": products_df, "Sales": sales_df})
131
+ model.add_column("Products", "Rank", [3, 2, 1])
132
+ model.set_sort_column("Products", "Category", "Rank")
133
+ model.add_hierarchy("Products", "Catalog", ["Category", "ProductID"])
134
+ model.add_relationship("Sales", "ProductID", "Products", "ProductID")
135
+ model.save("created.xlsx")
136
+ ```
137
+
138
+ The example expects three product rows. Pass `workbook="ordinary.xlsx"` to
139
+ `create` to preserve an existing workbook's worksheets while inserting a model.
140
+ `add_table` accepts an independent dataframe. `rename_table`, `remove_table`,
141
+ `rename_column`, `remove_column`, `change_column_type`, `configure_table` and
142
+ `configure_column` cover schema and display edits. Dependency guards reject
143
+ unsupported changes involving existing calculations or presentation objects.
144
+
145
+ Hierarchies support `update_hierarchy`, `configure_hierarchy` and
146
+ `remove_hierarchy`. Pass the displayed hierarchy name, even when a native
147
+ workbook uses a different internal identifier. Relationships support `set_relationship_active` and
148
+ `remove_relationship`. `set_sort_column(..., by=None)` restores default ordering.
149
+ DAX calculation-engine work is separate; existing measure-writing support remains.
150
+
151
+ `to_bytes()` is intended for web responses:
152
+
153
+ ```python
154
+ payload = workbook.to_bytes()
155
+ ```
156
+
157
+ Every save is independently reopened with PBIXRay by default. Requested values,
158
+ row counts, measures, existing relationships, and new relationships are checked
159
+ before the generated path is returned. Pass `validate=False` only when an
160
+ application has its own validation boundary.
161
+
162
+ ## Model as code
163
+
164
+ ```yaml
165
+ tables:
166
+ Claims:
167
+ source: data/claims.csv
168
+ Providers:
169
+ source: data/providers.parquet
170
+ relationships:
171
+ - from: Claims.ProviderID
172
+ to: Providers.ProviderID
173
+ measures:
174
+ - table: Claims
175
+ name: Total Charges
176
+ expression: SUM('Claims'[ChargeAmount])
177
+ format: "$#,##0.00"
178
+ display_folder: Finance
179
+ ```
180
+
181
+ Build it with paths resolved relative to the specification:
182
+
183
+ ```bash
184
+ excelmodel build template.xlsx report.xlsx model.yaml
185
+ ```
186
+
187
+ Create from a specification with no template:
188
+
189
+ ```bash
190
+ excelmodel create report.xlsx model.yaml
191
+ excelmodel create report.xlsx model.yaml --workbook ordinary.xlsx
192
+ ```
193
+
194
+ `build` replaces named existing tables and adds new table names. CSV definitions
195
+ can include `read_options` forwarded to Pandas (for example `dtype` or
196
+ `parse_dates`). Install `excel-data-model-lab[parquet]` for Parquet input. Table
197
+ definitions can also contain `hidden`, `description`, `columns` (per-column
198
+ `hidden`, `description`, `format`, `sort_by`) and `hierarchies` (`name`, `levels`,
199
+ optional `hidden`, `description`, `level_names`). Paths are relative to the spec.
200
+
201
+ ## Supported model data
202
+
203
+ ### KPIs and calculation-area visibility
204
+
205
+ Create a three-state, higher-is-better KPI using an existing target measure:
206
+
207
+ ```python
208
+ model.add_kpi("Sales", "Total Amount", target_measure="Target Amount",
209
+ lower=0.4, upper=0.8)
210
+ print(model.list_kpis())
211
+ model.update_kpi("Sales", "Total Amount", target_measure="Target Amount",
212
+ lower=0.5, upper=0.95)
213
+ model.remove_kpi("Sales", "Total Amount") # Retains both user measures.
214
+ model.update_measure("Sales", "Target Amount", expression="120", format_string="0")
215
+ # Independent measures can also be removed with model.remove_measure(table, name).
216
+ ```
217
+
218
+ The example uses percentage thresholds. KPIs also support fixed targets,
219
+ absolute thresholds, ascending/descending and centered modes, and multiple native
220
+ icon sets. See [the KPI guide](docs/CALCULATED_COLUMNS_AND_KPIS.md) for supported
221
+ combinations. The API writes native metadata and helper formulas; it does not
222
+ evaluate DAX. Newly visible measures receive separate
223
+ calculation-area rows; existing saved measure positions are retained.
224
+ Measure removal rejects calculation and existing PivotTable dependencies;
225
+ remove a base measure's KPI before editing that base measure. Measure names
226
+ must be unique across the model, ignoring case.
227
+
228
+ - Existing tables can be replaced individually or atomically as a group.
229
+ - Row counts can shrink or grow.
230
+ - Integer, real, Currency, Date, nullable numeric, and dictionary-encoded string
231
+ columns are supported for the tested template encodings.
232
+ - Pure bit-packed, hybrid RLE, and multi-segment IDF data are regenerated.
233
+ - String and numeric dictionaries and numeric hash indexes are regenerated.
234
+ - DAX measures can include format strings, display folders, and descriptions.
235
+ - Active and inactive many-to-one relationships can be added.
236
+ - Untouched XLSX members and unknown ABF virtual files are preserved.
237
+ - Output remains a normal, self-contained `.xlsx` package.
238
+
239
+ Use schema inspection before selecting a template:
240
+
241
+ ```bash
242
+ excelmodel schema template.xlsx
243
+ excelmodel inspect template.xlsx --semantic
244
+ ```
245
+
246
+ ## Compatibility boundaries
247
+
248
+ A full table replacement must provide every non-engine column in that table.
249
+ Creating new models uses a bundled synthetic seed; no caller-supplied template
250
+ is required. Existing workbook presentation parts are preserved, and unsupported
251
+ schema changes with presentation dependencies are rejected.
252
+
253
+ The current authoring backend has limits: new stored column identifiers are
254
+ restricted. Text dictionary ordering supports pinned en-US/en-GB collation;
255
+ unsupported locales and codepoints are rejected. Numeric dictionaries support
256
+ values beyond the arithmetic encoding's signed 32-bit ID span. The supported
257
+ authoring range is `-9223372036854775807` through `9223372036854775806` for integers
258
+ and `-922337203685477.5807` through `922337203685477.5806` for Currency, inclusive.
259
+ The immediately adjacent signed64 endpoints are rejected after native aggregate
260
+ failures; existing endpoint values remain readable. Isolated native DAX queries
261
+ returned exact aggregates for the supported boundaries. New datetime columns support
262
+ timezone-naive values through whole seconds. Subsecond values are rejected.
263
+ The independent reader's floating-point date artifacts are normalized only to
264
+ the whole-second grid declared by value-encoding metadata. Empty tables use native
265
+ zero-row storage; use `replace_table` to populate all their columns together.
266
+ The integrated API's create/populate/clear outputs pass desktop Power Pivot
267
+ acceptance. Unrecognized storage layouts are rejected rather than rewritten
268
+ speculatively. Combined native load, calculation, filtering, hierarchy and
269
+ reopen checks pass, including tiny dictionaries and nullable numeric lifecycles.
270
+
271
+ External data connections are preserved as package content. The API can author
272
+ Excel-native linked-table and OLE DB source bindings, but does not execute Excel's
273
+ refresh engine. Linked-table refresh has passed a native test; SQL Server two-source refresh, rebind, detach and save/reopen have passed native
274
+ checks using authorized credentials supplied through Excel data APIs. The public
275
+ writer rejects embedded passwords; it does not manage Excel session credentials. Enabling an old
276
+ workbook's external refresh can replace stored values from its original source.
277
+
278
+ ### Refreshing stored data through Python
279
+
280
+ Use `refresh_sources` to read CSV, Parquet, or a parameterized SQL query into
281
+ existing tables. All sources are read and checked before any table update is
282
+ applied. Each source must supply every stored column in its target table.
283
+
284
+ ```python
285
+ from excel_model_lab import WorkbookModel, CsvSource, ParquetSource, SqlSource
286
+
287
+ model = WorkbookModel("model.xlsx")
288
+ model.refresh_sources({
289
+ "Sales": CsvSource("sales.csv"),
290
+ "Products": ParquetSource("products.parquet"),
291
+ })
292
+ print(model.tables)
293
+ print(model.get_table("Sales"))
294
+ model.save("refreshed.xlsx")
295
+
296
+ # With a caller-owned SQLite or SQLAlchemy connection:
297
+ # model.refresh_sources({"Sales": SqlSource(connection,
298
+ # "SELECT * FROM sales WHERE year = :year", params={"year": 2026})})
299
+ ```
300
+
301
+ Parquet requires the optional `parquet` dependency. Readers accept
302
+ `read_options` for pandas options such as CSV dtypes. SQL connections remain
303
+ owned by the caller. Source paths, connection credentials, and query bindings
304
+ are not saved as workbook refresh connections. This method reads stored data;
305
+ it does not evaluate DAX.
306
+
307
+ Workbook presentation layout authoring, a DAX engine, universal historical
308
+ VertiPaq/encrypted-workbook compatibility, and `.xls`/`.xlsb`/VBA authoring are
309
+ outside this work. Unsupported encodings fail before committing the destination.
310
+ Independent decoder validation does not replace desktop Excel acceptance.
311
+
312
+ ## Development
313
+
314
+ ```bash
315
+ python -m pip install -e .
316
+ python -m pytest -q
317
+ python -m build
318
+ ```
319
+
320
+ Low-level laboratory commands remain available under `excelmodel --help` for ABF
321
+ inventory, extraction, cloning, diffing, and controlled IDF mutation.
322
+
323
+ ### Explicit relationship cardinality
324
+
325
+ `add_relationship(..., cardinality="many-to-one")` retains the existing default.
326
+ Use `one-to-many` to supply the lookup end first; the API normalizes the stored
327
+ endpoints to many-to-one. Removal/activation use these normalized endpoints.
328
+ Use `one-to-one` to require unique keys at both ends and write One/One metadata.
329
+ Explicit One/One metadata passed native save/reopen acceptance.
330
+
331
+ Invalid cardinality, duplicate keys, type mismatches and invalid active paths
332
+ raise `RelationshipValidationError`, a `ValueError` subclass. Duplicate errors
333
+ include the table, column, value and one-based data row positions. Missing
334
+ columns retain `KeyError`. Checks run at definition and again before saving
335
+ changed relationship keys, even when `save(validate=False)` is used. Activation
336
+ changes retain cardinality. Validation does not require every foreign key to
337
+ match: unmatched rows retain Excel's blank-member behavior.
338
+
339
+ Blank lookup keys remain an implementation limitation (`UnsupportedModelError`),
340
+ not a claim that Excel rejects every blank. Text keys use Windows en-US linguistic comparison when available; other locales
341
+ and equivalent distinct spellings within a dictionary remain guarded.
342
+
343
+ ## Read-only inspection and streaming
344
+
345
+ The reader does not initialize the writer or require write-compatible encodings.
346
+ It delegates to the pinned PBIXRay 0.15.5 public API. It supports the formats that
347
+ PBIXRay supports (XLSX/PBIX/ABF); this does not add PBIX/ABF writing. Excel fixture
348
+ parity and resource lifecycle are tested here; broad format coverage comes from
349
+ PBIXRay rather than a new independent compatibility certification.
350
+
351
+ ```python
352
+ from excel_model_lab import WorkbookModel
353
+
354
+ with WorkbookModel.open("report.xlsx", on_disk=True) as reader:
355
+ print(reader.tables)
356
+ print(reader.schema)
357
+ print(reader.relationships)
358
+ print(reader.dax_measures)
359
+ print(reader.mashup_queries)
360
+ for chunk in reader.iter_table("Sales", columns=["Amount"], chunk_size=10000):
361
+ process(chunk)
362
+ ```
363
+
364
+ `ModelReader` is also directly importable. All public PBIXRay metadata properties
365
+ are exposed, including `connections`, `data_mashup`, `perspectives`, `statistics`
366
+ and the `tmschema_*` properties. Availability and empty results depend on the
367
+ source format. Processed model values normalize declared/inferred types, preserving Currency as
368
+ Decimal and calculated dates, booleans and integers. Upstream format limitations remain. Keep the reader open while consuming
369
+ an iterator. Closing it releases resources; materialized DataFrames remain usable.
370
+
371
+ For editing, use `WorkbookModel.open("report.xlsx", read_only=False)` or the
372
+ existing constructor. Readers show the saved source, not another editor's staged
373
+ changes. Writer `get_table()` continues to include its staged data changes.
374
+
375
+ ## Preflight validation
376
+
377
+ ```python
378
+ model = WorkbookModel.open("report.xlsx", read_only=False)
379
+ report = model.validate()
380
+ for issue in report.issues:
381
+ print(issue.severity, issue.code, issue.message)
382
+ report.raise_for_errors()
383
+ ```
384
+
385
+ Current checks cover relationship key uniqueness, type compatibility, duplicate
386
+ relationships, self-links and ambiguous active paths, plus warnings for columns
387
+ outside the writer's supported encodings. Pending measure-name conflicts are also
388
+ reported before saving. This is not complete formula/dependency
389
+ validation, DAX evaluation or proof of native Excel compatibility. Existing
390
+ save-time checks remain in place. Report validity means no errors in these checks.
391
+
392
+
393
+ ## Unicode and locale contract
394
+
395
+ String dictionary and relationship comparison supports pinned en-US and en-GB
396
+ collation. Windows uses NLS; the packaged portable tables provide the supported
397
+ comparison behavior on Linux, including tested Japanese context and Jamo cases.
398
+ Unsupported locales or codepoints fail explicitly. Actual macOS validation is
399
+ still pending. Equivalent distinct dictionary spellings are rejected rather than
400
+ silently rewritten; matching keys in different tables may compare equal.
401
+ Embedded NUL characters are rejected.
402
+
403
+ Native Unicode table rows and relationship filtering passed save/reopen checks.
404
+ See [STATUS.md](STATUS.md) and the native acceptance ledger for tested grouping,
405
+ dictionary layouts and platform boundaries.
406
+
407
+ ## Calculated columns and date keys
408
+
409
+ ```python
410
+ model.add_calculated_column("Sales", "Double Amount", "[Amount] * 2",
411
+ data_type="currency")
412
+ model.update_calculated_column("Sales", "Double Amount", "[Amount] * 3",
413
+ data_type="currency")
414
+ model.remove_calculated_column("Sales", "Double Amount")
415
+ ```
416
+
417
+ Explicit types are `integer`, `decimal`, `currency`, `datetime`, `boolean` and
418
+ `text`. Definitions are stored with unprocessed caches; Excel performs DAX
419
+ calculation. The library does not invent calculated results. All six explicit
420
+ types and calculated resizing/empty-table lifecycles passed native processing
421
+ and save/reopen checks. Calculated relationships and stored-column sorting by calculated keys passed
422
+ native processing/save/reopen, including changed inputs and dependent hierarchy
423
+ checks. Final combined regression and local artifact verification passed; see
424
+ [STATUS.md](STATUS.md) for the recorded results.
425
+
426
+ `mark_date_table(table, column)` requires a nonempty stored datetime column with
427
+ unique, nonblank, contiguous whole dates. `unmark_date_table(table)` restores the
428
+ internal row key. Stored date marking passed native processing/save/reopen.
429
+ Calculated date keys remain explicitly unsupported: a processed same-table
430
+ computed date key failed native processing with a circular dependency. This is
431
+ a documented limitation, not a claim that every DAX expression is forbidden by
432
+ all Excel versions. Pending values cannot establish uniqueness or contiguity.
@@ -0,0 +1,76 @@
1
+ excel_data_model_lab-0.5.0rc1.dist-info/licenses/LICENSE,sha256=Iwg8OoBDC0jycWm2RJP0RbIMGbUsWKEpNz66vYHjJTo,1085
2
+ excel_data_model_lab-0.5.0rc1.dist-info/licenses/THIRD_PARTY_NOTICES.md,sha256=tw_DjGInTkDzzRh3nFaMSi2yAj87-727yrbuxae-Fwc,4159
3
+ excel_model_lab/__init__.py,sha256=H3QdNszwQZfgL7RVUgiCFcM73Y0BVFTwnKWseBMYB2k,4752
4
+ excel_model_lab/abf.py,sha256=yj7qUkEYUcPtuD1DPmoCMOExCmPDR_7RbkTeT46kRzI,27324
5
+ excel_model_lab/agent_workflow.py,sha256=n0cxWdLttkxPsUZWf3ZW5JMKkuvQSEL8hXc2LpMr0nQ,20231
6
+ excel_model_lab/calculated_columns.py,sha256=IN9jE84pOUvXeRYTBshKpwqC62Uz9WgySAz38ix1MQ4,25922
7
+ excel_model_lab/cli.py,sha256=w4ZABAfmeNabLQZ9RPrq6xD1HnkZoLyHk7MxvKfgGm4,9045
8
+ excel_model_lab/collation.py,sha256=ueYH97pE8XSImgaxgdmlX-1IjgBXlTbeLhGCHmN1T8M,3438
9
+ excel_model_lab/column_import.py,sha256=DiGErU-XrFJfC6rMIzIYFzgJAbNg5NPsubkVzMufB-w,6694
10
+ excel_model_lab/composition.py,sha256=Ty6GlgLugMxAe3R8tImcQG9YlR3Dy-EMoILsAsCYovI,4127
11
+ excel_model_lab/cube_cache.py,sha256=LBIvQ7Y82B095AuvAovZlgEMboX0uXtJGto-BCq0ohs,5214
12
+ excel_model_lab/cube_formulas.py,sha256=g7KuAa0ywmsB7Vw38cXVHNrfE0NfFJOxCTMJoNdOkqE,8223
13
+ excel_model_lab/cube_source_view.py,sha256=UGWO_tGWsy2hWJUViaB5yHPDg5Z0o4v16KbU1htSzFw,10719
14
+ excel_model_lab/date_tables.py,sha256=ygAg7YGD956aFQSPO4qQ-5mi7LSVPWre5bv0MpL0_fc,9328
15
+ excel_model_lab/dax_evaluation.py,sha256=vUkD3jw4VMsBgGYwpdDB3m9dTad9P2Ko-cZZTY1O0pQ,16448
16
+ excel_model_lab/dax_validation.py,sha256=Yws_byYpwGMFrssIkmtpkvwYH0mzRk7pTnOTEA_ltEA,19126
17
+ excel_model_lab/dependencies.py,sha256=rPhBxgmxEXPJ_-fZXeufy8u4NRGRCrseOOEEzNM20Lw,16613
18
+ excel_model_lab/desktop_session.py,sha256=MZ5PztrjwAnejPfHzxgTr8T6_kJSeXAg_OFJu7VbFvs,18658
19
+ excel_model_lab/dictionary.py,sha256=PD4HZ7BWfFOyQatZqLBZKRhxCwHYLCCr1-T3vU94laE,7095
20
+ excel_model_lab/empty_storage.py,sha256=BSkImvr6554ef6s7foza672rDKYt3_N1yvTHsp9zcKk,11890
21
+ excel_model_lab/errors.py,sha256=3d9htOXJ6IgP81YVbpYvSetQjaMuksqS_kizWYd8Tbw,477
22
+ excel_model_lab/excel_metadata.py,sha256=4lVgmE_sDyG2thWdsNN7KD4KhyW083RWXDnnHaO5HXM,8607
23
+ excel_model_lab/external_connections.py,sha256=3jS9SRjXNQXW5OiHwK5-036YvHbI5UWhIzTT8JfE8Hg,15718
24
+ excel_model_lab/formula_statements.py,sha256=u-ROTaE76s_8hcEArbPIWGIYpIXCduQ2SfHOhpiEa-I,7963
25
+ excel_model_lab/hash_index.py,sha256=QXmSdA0klGDfim8MXNQQ4RhZAn0s0IVf-D7O61AyvaQ,3404
26
+ excel_model_lab/hierarchy_storage.py,sha256=FJY_btYA98AIMj1QTjl8T3gyfgXMGwH1qNhwFEP7q4c,17977
27
+ excel_model_lab/kpis.py,sha256=m1uBGGMKpnpaYjC-hmJTn3v2l9hoOYkPNmJDewK29e8,14844
28
+ excel_model_lab/lookup.py,sha256=vWmpCnbQ5VrxsP6r5MdRMNzA2LqPfDAi5WdzAYho3NM,8634
29
+ excel_model_lab/measure_edit.py,sha256=BfZStQ-5ZQSEFIAixilt7WTKSddYSg6m0GE531DiiZc,2885
30
+ excel_model_lab/measure_layout.py,sha256=KL8pIzSu2HPqd1QZlhv4-QokVohohZlsra1wxtaS33Y,12717
31
+ excel_model_lab/measures.py,sha256=VJ9fPpBlZ-uaJgM1_GjLmj067o_YY8tfqHA2ie7mxEE,4346
32
+ excel_model_lab/metadata.py,sha256=M9ScEP76DtwVcdpzdz6hjmm3VRCfwD6ESzRdB1kKhHM,10928
33
+ excel_model_lab/model.py,sha256=oEaN32jpXERol3hNz5l5xYXuP7VWYUNIqvkHmBMND5E,116306
34
+ excel_model_lab/mutate.py,sha256=VCmBUWRq_WPfSt5dj7oQZKn5phTy09YgMxVWVV_a8Bk,4098
35
+ excel_model_lab/native_sources.py,sha256=suUpZ5NT96I3XnIPZjNN4IEbjonpTEkfoI9ro2FPYzo,15985
36
+ excel_model_lab/null_dictionary.py,sha256=Yr2ADbit_3o7PFC9SIHTmvb25QiO6QcN7JoKIYdesPg,1574
37
+ excel_model_lab/numeric_storage.py,sha256=msYV3wCOQ56HGkBq6EpoULVs2995kqIXGm3rbrzQUvU,16097
38
+ excel_model_lab/ole_db.py,sha256=CgCRZHkJ03LnSRa28EUVc5lK4OiWoPslDpv6tngE81o,18252
39
+ excel_model_lab/package.py,sha256=eeR9gYQWdKpwkGv-e-EWS4uWdHjDGqdCyj6MH9jC_K8,9028
40
+ excel_model_lab/perspectives.py,sha256=-OilDBwK1DNbD91yddlTgkHjMoBGMnImT0FCeSqFguk,19296
41
+ excel_model_lab/portable_nls.py,sha256=O-Mk-zcOoI9fYgT2TjzyfgqvlClEmkAqWv_bT3UHqE4,6608
42
+ excel_model_lab/preserve.py,sha256=v4x6Q3dBdjvqnh9yqYMLkf9xJWrT30Xd4PhAxYPwJoQ,6860
43
+ excel_model_lab/reader.py,sha256=Qx5TQjqDP6oSnw0pv8XbQfmpp7AxEMno-aLdxG8etDY,14790
44
+ excel_model_lab/reader_adapter.py,sha256=RP_W4diO2SAL7Toa3FxIAJmcHSnMvm01k8sry-76lac,4856
45
+ excel_model_lab/relationship_storage.py,sha256=r46nJqiZgZwRN4qQRuY3NcCtFlfSvls-9WKR61FrCcs,27075
46
+ excel_model_lab/relationships.py,sha256=z075XOF2Dn67oKs4LhX5nOyq9EJw7C3pWSX-A6EWI0w,5988
47
+ excel_model_lab/report_charts.py,sha256=S9848VScBAisEkLWxjNnZ2nL_raMaXOAcvIZ3Y8deAc,9311
48
+ excel_model_lab/report_editing.py,sha256=L4-Wv2ACyILkQ_SPt_QxY9sPHje8LfpwcwfmKYIQMUw,54849
49
+ excel_model_lab/report_filters.py,sha256=bBLXcKZGebEi3yBv8RvCUkQ4IA022KJi4lUPcvsgoj8,10929
50
+ excel_model_lab/report_package.py,sha256=O5x1isDl5FGwCMdaSjj7luo1DwzqFpLAEMR5vVPzoz8,21528
51
+ excel_model_lab/report_slicers.py,sha256=ilvk842z67sEOfKGQUBRT_Ce-2ti9yD9JlIpIksnkjc,20939
52
+ excel_model_lab/reports.py,sha256=jHR93yeCm6k-8tsjIbukfMlxYnshKe8edw9ZfIlVrWo,24782
53
+ excel_model_lab/schema.py,sha256=b1YWUuZOJcg0jc5nPDBgHiiHCpc7RgVxaocoerzfeOk,40863
54
+ excel_model_lab/sorting.py,sha256=mZfTe4tfrGgWP9bZMJdGa4l5U36ZIY5QnS34xN6gbuU,5349
55
+ excel_model_lab/source_crypto.py,sha256=_5NeDDemEkPycPOF7zpxryvlGlyfGnFVJ_5iDRAtaJM,2355
56
+ excel_model_lab/sources.py,sha256=aCWL0m6OXeyerEs-6dXy-o_GcNN1Z_k_DS_lu9L0WWE,1426
57
+ excel_model_lab/spec.py,sha256=sGrzuu7a4SfXBH-6NSCsMIejQefp8Om39Z_zhr0Vw_k,8085
58
+ excel_model_lab/structural_edit.py,sha256=DPN1BjCn6w_o3N04FO25V2iqDZNVJciuSp74oILOFns,13707
59
+ excel_model_lab/validation.py,sha256=sNARrJTxEMfkK0jvgn_oeLn8zK3ZqENTG0Nn8Hmrhm4,6298
60
+ excel_model_lab/vertipaq.py,sha256=3UvkdHiQYMbg9HNtsv_Dkiy8iDzQOW27o1nMuX7F4jY,13904
61
+ excel_model_lab/data/authoring-seed.xlsx,sha256=qJMYDDgpaNbz0S3WrRry_pS1ssCb1SWATgf2VaGeI0o,17874
62
+ excel_model_lab/data/empty-table.xml,sha256=xmWA5vfc49RDyv9MXttAYHZSf12az_kNzM0tiPnJ9S0,17169
63
+ excel_model_lab/data/hierarchy-index.xml,sha256=kJqlRAIjNLnw3KP29Cy1898Jl6x7HfKTXt-82gj1GMk,15425
64
+ excel_model_lab/data/kpi-properties.xml,sha256=KRFBabcd-J2t-L6vQhjcElM6K0rqfNJeOSk26B4stXg,6895
65
+ excel_model_lab/data/measure-diagram.xml,sha256=r3tuESIuIAN8vD0UwGr7k4mbGB2bD7MpnGgmnYU51ZU,14420
66
+ excel_model_lab/data/measure-grid.xml,sha256=0ZcXndvcsErXQxvrrI_GmnDKhhkcR51pxzXBkVAhR5A,602
67
+ excel_model_lab/data/nls-en-v1.bin.gz,sha256=dFqh4iK-0WWU-hOHi32G5dzBqOJCeTayVgJU22ItRiY,762788
68
+ excel_model_lab/data/nls-en-v1.json,sha256=UvBO88DTQonKLgaDT5IFe-CABO50VG1UXS4XrYv4o4Y,1137
69
+ excel_model_lab/data/nls-jamo-v1.json,sha256=6d6WTlaaroSAGd6bUfiW7DnWmAuOJ2AdTZe5hXGM9M4,12148
70
+ excel_model_lab/data/relationship-index.xml,sha256=5gXH04uYQPjaXp1YNzsDnMeTQunlDUOmqRYq8599H4I,3898
71
+ excelmodel/__init__.py,sha256=DY0ofU5jDnqx1uzJBJT68LK8cB6l6HuSRY8U5QSFiKw,144
72
+ excel_data_model_lab-0.5.0rc1.dist-info/METADATA,sha256=Jq6oa8lzEjs-xqjGLtVXGtBX1hw1qGIdmBnkbhkQyvA,20594
73
+ excel_data_model_lab-0.5.0rc1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
74
+ excel_data_model_lab-0.5.0rc1.dist-info/entry_points.txt,sha256=wr_M18IH8c8KKAS0dBEnVlKu-cek1YAZhjn6MfCuzW8,94
75
+ excel_data_model_lab-0.5.0rc1.dist-info/top_level.txt,sha256=bsAR03t04WCmf4pFac37WNSeR4ljymEWfae70PC7NDo,27
76
+ excel_data_model_lab-0.5.0rc1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ excelmodel = excel_model_lab.cli:main
3
+ xmodel-lab = excel_model_lab.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 excel-model-lab contributors
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.
@@ -0,0 +1,83 @@
1
+ # Third-party notices
2
+
3
+ ## Optional workbook and evaluation dependencies
4
+
5
+ The `workbooks` extra installs XlsxWriter separately for worksheet authoring.
6
+ The `dax` extra installs the MIT-licensed pbix-mcp 0.9.153 distribution separately;
7
+ the adapter uses its Python DAX evaluator through a bounded, independently tested
8
+ interface. No upstream evaluator source is copied into this package. See
9
+ `docs/phase6-evaluation.md` for the audited wheel identity and supported scope.
10
+ The `external-query` extra installs pythonnet separately. Microsoft ADOMD.NET
11
+ and Analysis Services are not bundled or installed automatically by this library.
12
+ Each optional dependency and its transitive dependencies retain their own licenses.
13
+
14
+ Projects: https://github.com/jmcnamara/XlsxWriter,
15
+ https://github.com/d0nk3yhm/pbix-mcp, https://github.com/pythonnet/pythonnet.
16
+
17
+ ## PBIXRay
18
+
19
+ The package depends on PBIXRay 0.15.5 by Igor Cotruta. Its reader and format
20
+ research underpin this project. PBIXRay is installed separately as a dependency.
21
+ Its license is reproduced below for attribution; it does not select the license
22
+ for this project's original code or establish rights to redistribute fixtures.
23
+
24
+ MIT License
25
+
26
+ Copyright (c) 2024 Igor Cotruta
27
+
28
+ Permission is hereby granted, free of charge, to any person obtaining a copy
29
+ of this software and associated documentation files (the "Software"), to deal
30
+ in the Software without restriction, including without limitation the rights
31
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32
+ copies of the Software, and to permit persons to whom the Software is
33
+ furnished to do so, subject to the following conditions:
34
+
35
+ The above copyright notice and this permission notice shall be included in all
36
+ copies or substantial portions of the Software.
37
+
38
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44
+ SOFTWARE.
45
+
46
+
47
+ ## PivotWright format research
48
+
49
+ The native source encryption and source-binding format work was cross-checked
50
+ against PivotWright by Matthew Moore, in addition to Microsoft MS-XLDM
51
+ specifications and native Excel files. PivotWright is not a runtime dependency.
52
+ Repository: https://github.com/MatthewMooreZA/PivotWright
53
+
54
+ MIT License
55
+
56
+ Copyright (c) 2026 Matthew Moore
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy
59
+ of this software and associated documentation files (the "Software"), to deal
60
+ in the Software without restriction, including without limitation the rights
61
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
+ copies of the Software, and to permit persons to whom the Software is
63
+ furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in all
66
+ copies or substantial portions of the Software.
67
+
68
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74
+ SOFTWARE.
75
+
76
+ ## Optional desktop adapter
77
+
78
+ The `desktop` extra installs xlwings 0.33.x separately (open-source core, BSD
79
+ 3-Clause license). The adapter uses the ordinary desktop automation API, not
80
+ xlwings PRO features. Microsoft Excel is separately installed and licensed;
81
+ neither Excel nor xlwings binaries are bundled in this distribution.
82
+ Project: https://github.com/xlwings/xlwings
83
+ License: https://github.com/xlwings/xlwings/blob/main/LICENSE.txt
@@ -0,0 +1,2 @@
1
+ excel_model_lab
2
+ excelmodel