aibi-toolkit 1.2.0__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.
- aibi_toolkit/__init__.py +44 -0
- aibi_toolkit/__main__.py +12 -0
- aibi_toolkit/audit.py +46 -0
- aibi_toolkit/autofix.py +47 -0
- aibi_toolkit/cli.py +79 -0
- aibi_toolkit/cli_internal.py +97 -0
- aibi_toolkit/config.py +73 -0
- aibi_toolkit/csvio.py +54 -0
- aibi_toolkit/dax.py +88 -0
- aibi_toolkit/diagram.py +28 -0
- aibi_toolkit/filters.py +28 -0
- aibi_toolkit/integrity.py +47 -0
- aibi_toolkit/lint.py +34 -0
- aibi_toolkit/measure.py +131 -0
- aibi_toolkit/metadata.py +92 -0
- aibi_toolkit/naming.py +136 -0
- aibi_toolkit/profile.py +61 -0
- aibi_toolkit/py.typed +0 -0
- aibi_toolkit/report.py +79 -0
- aibi_toolkit/sample.py +54 -0
- aibi_toolkit/tables.py +43 -0
- aibi_toolkit-1.2.0.dist-info/METADATA +218 -0
- aibi_toolkit-1.2.0.dist-info/RECORD +27 -0
- aibi_toolkit-1.2.0.dist-info/WHEEL +5 -0
- aibi_toolkit-1.2.0.dist-info/entry_points.txt +2 -0
- aibi_toolkit-1.2.0.dist-info/licenses/LICENSE +21 -0
- aibi_toolkit-1.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aibi-toolkit
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Clean up Power BI / Tableau semantic-model metadata: naming, format strings, DAX snippets, hygiene auditing, linting, diagrams and reports
|
|
5
|
+
Author: Sourin Rakshit
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Sourin Rakshit
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/SourinRakshit-ai/aibi-toolkit
|
|
29
|
+
Project-URL: Changelog, https://github.com/SourinRakshit-ai/aibi-toolkit/blob/main/CHANGELOG.md
|
|
30
|
+
Project-URL: Issues, https://github.com/SourinRakshit-ai/aibi-toolkit/issues
|
|
31
|
+
Keywords: powerbi,tableau,dax,tmdl,semantic-model,lint
|
|
32
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Operating System :: OS Independent
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
39
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
40
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
41
|
+
Requires-Python: >=3.10
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
License-File: LICENSE
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest; extra == "dev"
|
|
46
|
+
Requires-Dist: mypy; extra == "dev"
|
|
47
|
+
Requires-Dist: ruff; extra == "dev"
|
|
48
|
+
Provides-Extra: docs
|
|
49
|
+
Requires-Dist: mkdocs-material; extra == "docs"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# aibi-toolkit
|
|
53
|
+
|
|
54
|
+
*aibi* — CLI + library for cleaning up Power BI / Tableau semantic-model
|
|
55
|
+
metadata. Companion to [aibi-dax](https://github.com/SourinRakshit-ai/aibi-dax):
|
|
56
|
+
where aibi-dax checks the DAX expressions inside your measures, aibi-toolkit
|
|
57
|
+
checks the model around them — naming conventions, format strings, duplicate
|
|
58
|
+
measures, empty tables, relationships, hygiene.
|
|
59
|
+
|
|
60
|
+
[](https://github.com/SourinRakshit-ai/aibi-toolkit/actions/workflows/ci.yml)
|
|
61
|
+
[](https://github.com/SourinRakshit-ai/aibi-toolkit/actions/workflows/lint.yml)
|
|
62
|
+
[](pyproject.toml)
|
|
63
|
+
[](pyproject.toml)
|
|
64
|
+
[](.github/workflows/lint.yml)
|
|
65
|
+
[](https://sourinrakshit-ai.github.io/aibi-toolkit/)
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
Runnable walkthroughs live in [`examples/`](examples/#readme).
|
|
69
|
+
|
|
70
|
+
## Why this exists
|
|
71
|
+
|
|
72
|
+
A semantic model is a shared asset, and it always drifts. Measure names pick
|
|
73
|
+
up stray spaces, missing format strings, duplicate definitions that nobody
|
|
74
|
+
deletes, and DAX smells that pass casual review. Nobody catches it, because
|
|
75
|
+
each file is small but the model is large, and nobody wants to be the one
|
|
76
|
+
recounting the measures by hand.
|
|
77
|
+
|
|
78
|
+
That is the failure mode aibi-toolkit was built for. It reads the dump, runs
|
|
79
|
+
the checks, gives you a score, and names the findings. The first pass
|
|
80
|
+
usually looks like: score 38, a dozen missing format strings, six duplicate
|
|
81
|
+
measures.
|
|
82
|
+
|
|
83
|
+
## What it does
|
|
84
|
+
|
|
85
|
+
- **`aibi audit`** — measure hygiene findings and a 0-100 score.
|
|
86
|
+
Checks format strings, case-insensitive duplicate names, and measure
|
|
87
|
+
name length. Exit 1 when anything is found, 0 when the model is clean,
|
|
88
|
+
so a CI gate is one command.
|
|
89
|
+
- **`aibi lint`** — static checks on the DAX expressions: raw `/` without
|
|
90
|
+
`DIVIDE`, no-argument `ALLSELECTED()`, `CALCULATE([])`, and `IFERROR`
|
|
91
|
+
masking.
|
|
92
|
+
- **`aibi fix`** — applies naming and format-string fixes with `--dry-run`
|
|
93
|
+
so you always see what would change before it changes.
|
|
94
|
+
- **`aibi summary`** — object counts; **`aibi tables`** — table list.
|
|
95
|
+
- **`aibi report`** — markdown audit report: score, finding counts,
|
|
96
|
+
examples, for your own paper trail or a PR description.
|
|
97
|
+
- **`aibi diagram`** — mermaid ER diagram straight from the model.
|
|
98
|
+
- **`aibi profile`** — expression complexity: count, average, max weight,
|
|
99
|
+
and the heaviest measures named.
|
|
100
|
+
- **`aibi synth`** — generate a sample model for trying the tool.
|
|
101
|
+
- **`aibi export`** — measures to CSV for external row-checks.
|
|
102
|
+
|
|
103
|
+
Full module map:
|
|
104
|
+
|
|
105
|
+
| Area | Module |
|
|
106
|
+
| ------------------ | --------------- |
|
|
107
|
+
| Naming | `naming` |
|
|
108
|
+
| Format strings | `measure` |
|
|
109
|
+
| DAX snippets | `dax`, `filters`|
|
|
110
|
+
| Model inspection | `metadata` |
|
|
111
|
+
| Auditing + linting | `audit`, `lint` |
|
|
112
|
+
| Integrity | `integrity` |
|
|
113
|
+
| Autofixes | `autofix` |
|
|
114
|
+
| Diagrams | `diagram` |
|
|
115
|
+
| Reports | `report` |
|
|
116
|
+
| Demo data | `sample` |
|
|
117
|
+
| Renderers | `tables` |
|
|
118
|
+
| Configuration | `config` |
|
|
119
|
+
| Profiling | `profile` |
|
|
120
|
+
| CSV round-trip | `csvio` |
|
|
121
|
+
|
|
122
|
+
## Install
|
|
123
|
+
|
|
124
|
+
Not on PyPI yet; install from the repository. Issue [#5](https://github.com/SourinRakshit-ai/aibi-toolkit/issues/5) tracks the trusted-publishing release:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git clone https://github.com/SourinRakshit-ai/aibi-toolkit.git
|
|
128
|
+
cd aibi-toolkit
|
|
129
|
+
pip install .
|
|
130
|
+
aibi --help
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Quick start
|
|
134
|
+
|
|
135
|
+
Generate a sample model, then check it:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
aibi synth model.json # write a sample model
|
|
139
|
+
aibi summary model.json # object counts
|
|
140
|
+
aibi audit model.json # hygiene findings + 0-100 score
|
|
141
|
+
aibi lint model.json # DAX rule findings
|
|
142
|
+
aibi audit model.json --json # machine-readable output (also: lint, profile)
|
|
143
|
+
aibi report model.json out.md # markdown audit report
|
|
144
|
+
aibi fix --dry-run model.json # preview fixes before writing anything
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Audit returns exit `1` when findings exist, `0` when clean, so a pipeline
|
|
148
|
+
that already has `set -e` fails immediately. Pass `--json` to `audit`,
|
|
149
|
+
`lint` or `profile` when you want a machine-readable result.
|
|
150
|
+
|
|
151
|
+
## How it helps
|
|
152
|
+
|
|
153
|
+
- **One number first.** The 0–100 score tells you whether the model
|
|
154
|
+
deserves attention before you read a single measure. Score 38 usually
|
|
155
|
+
means "regenerate formats and delete the dead duplicates"; score 92
|
|
156
|
+
means "quick answer, move on".
|
|
157
|
+
- **Names and formats are the fix.** Around 90% of findings in real
|
|
158
|
+
models are `missing_format` and duplicates after a bulk edit; both
|
|
159
|
+
are auto-fixable by `aibi fix` with `--dry-run` for confirmation.
|
|
160
|
+
- **Exit codes mean CI.** `aibi audit model.json` returns 1 with any
|
|
161
|
+
finding and 0 clean, so the release pipeline it belongs in fails where
|
|
162
|
+
the merge should wait for you.
|
|
163
|
+
- **The report is the artifact.** `aibi report` gives a reviewer the
|
|
164
|
+
score and a short list of examples, which is usually enough for the
|
|
165
|
+
release meeting.
|
|
166
|
+
|
|
167
|
+
## What it is not
|
|
168
|
+
|
|
169
|
+
- **Not an aibi-dax substitute.** It lints DAX for narrowly-scoped
|
|
170
|
+
patterns (raw `/`, no-arg `ALLSELECTED()`, `CALCULATE([])`, `IFERROR`
|
|
171
|
+
hiding). For deep complexity scoring and anti-pattern detection,
|
|
172
|
+
that is what [aibi-dax](https://github.com/SourinRakshit-ai/aibi-dax)
|
|
173
|
+
is for.
|
|
174
|
+
- **Not a full TMDL/PBIP authoring tool.** It reads shared-schema
|
|
175
|
+
model dumps; it does not write them back to disk yet
|
|
176
|
+
(tracked in [#6](https://github.com/SourinRakshit-ai/aibi-toolkit/issues/6)).
|
|
177
|
+
- **Not a bug finder for DAX logic.** It checks static patterns; it
|
|
178
|
+
cannot tell you your total is wrong. That still needs `EVALUATE`
|
|
179
|
+
checks and your eyes.
|
|
180
|
+
- **Not a performance tool.** It has no cost model for queries; it
|
|
181
|
+
flags patterns, not benchmarks.
|
|
182
|
+
|
|
183
|
+
## Commands
|
|
184
|
+
|
|
185
|
+
| Command | Purpose |
|
|
186
|
+
| ------- | ------- |
|
|
187
|
+
| `aibi summary model.json` | object counts |
|
|
188
|
+
| `aibi tables model.json` | list tables |
|
|
189
|
+
| `aibi audit model.json` | hygiene findings + 0-100 score |
|
|
190
|
+
| `aibi lint model.json` | DAX rule findings |
|
|
191
|
+
| `aibi fix --dry-run model.json` | preview naming/format fixes (omit `--dry-run` to apply) |
|
|
192
|
+
| `aibi profile model.json` | expression complexity: count, avg, max, heavy |
|
|
193
|
+
| `aibi diagram model.json` | mermaid ER diagram |
|
|
194
|
+
| `aibi export model.json out.csv` | measures to CSV |
|
|
195
|
+
| `aibi report model.json out.md` | markdown audit report |
|
|
196
|
+
| `aibi synth model.json` | generate a sample model |
|
|
197
|
+
|
|
198
|
+
## Docs and support
|
|
199
|
+
|
|
200
|
+
- **Docs site:** [sourinrakshit-ai.github.io/aibi-toolkit](https://sourinrakshit-ai.github.io/aibi-toolkit/) (`mkdocs gh-deploy`)
|
|
201
|
+
- **Issues:** [https://github.com/SourinRakshit-ai/aibi-toolkit/issues](https://github.com/SourinRakshit-ai/aibi-toolkit/issues)
|
|
202
|
+
- **Status:** `v1.2.0` on main. Not yet published to PyPI; trusted publishing
|
|
203
|
+
for the repo is tracked in [#5](https://github.com/SourinRakshit-ai/aibi-toolkit/issues/5),
|
|
204
|
+
with the pattern now proven by [aibi-dax](https://github.com/SourinRakshit-ai/aibi-dax).
|
|
205
|
+
- **Releases:** tagged `v*` triggers the `publish.yml` workflow once
|
|
206
|
+
trusted publishing is configured.
|
|
207
|
+
|
|
208
|
+
## Development
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
make install # pip install -e ".[dev]"
|
|
212
|
+
make test # pytest -q
|
|
213
|
+
make typecheck # mypy --strict src/aibi_toolkit/
|
|
214
|
+
make lint # ruff check src/ tests/
|
|
215
|
+
make serve-docs # mkdocs serve
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
MIT licensed. Roadmap lives in the issue tracker.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
aibi_toolkit/__init__.py,sha256=BneBx1A2GUdFwV-4Rude2JQMrAqlqV3WR_SyRtQMTlc,635
|
|
2
|
+
aibi_toolkit/__main__.py,sha256=pwN0zI4fqssv8p3sB2_qKED3ttOPQSDEzJsjj7CARrg,318
|
|
3
|
+
aibi_toolkit/audit.py,sha256=1DmcVSPE4PJ6kNFhQwyxpqYSbxPUiDqqJzrfpUEQ3HY,1611
|
|
4
|
+
aibi_toolkit/autofix.py,sha256=opvp8i7QsSm-a9UDsi5o_M6yRZxtU4YS1l66qDMkN38,1611
|
|
5
|
+
aibi_toolkit/cli.py,sha256=PBwAKagHeAVWmnaGHjvUxx4BSBsHlw0J0Jau1kMY9o0,3122
|
|
6
|
+
aibi_toolkit/cli_internal.py,sha256=C63UHRpH9LxM4bUtvrbt80VNECksRA7cQTDABdBks1Q,3129
|
|
7
|
+
aibi_toolkit/config.py,sha256=6hLz7iVVHdWNcGM-c5pTHT3FJVQ6CevL6L7oNgWqY2M,2601
|
|
8
|
+
aibi_toolkit/csvio.py,sha256=Qs7eeNnNnrmzAOia9-Mhyv3BtkCARlVIvXg5gIfGOG8,2014
|
|
9
|
+
aibi_toolkit/dax.py,sha256=0zoySHh_Tb8DE8O67vJNrZ8KWZM78xvsLMs3l9IRMJg,2795
|
|
10
|
+
aibi_toolkit/diagram.py,sha256=-K-73PZ8Pw1UbHFlUB67V85riyx93Zo3S61L42pBOGI,1106
|
|
11
|
+
aibi_toolkit/filters.py,sha256=Ikx3Ukg__jrK4xyQYX9spTtE1vqusStBgeSCIfgJFBI,1140
|
|
12
|
+
aibi_toolkit/integrity.py,sha256=Ga1uhhdNmX24XKRjiaqmL9zSJBWpsR2OpViu8C6nKns,1683
|
|
13
|
+
aibi_toolkit/lint.py,sha256=71Nv6hWEi5V_C3ssprwnMTzR_Qm54uVK3BYrLcHE4Nw,1183
|
|
14
|
+
aibi_toolkit/measure.py,sha256=7evrgHatTRnkZSoVPzEzKGee7qYD-htYNOvIP3P3Y90,4104
|
|
15
|
+
aibi_toolkit/metadata.py,sha256=t9hlOHFnp0H23IeEjpsd9KdbTtyTiTLf46AgwpoTJsI,2865
|
|
16
|
+
aibi_toolkit/naming.py,sha256=p2q7qnTikzhq706YkGIF6GdfMHCFjS-baptXziGWLgk,4160
|
|
17
|
+
aibi_toolkit/profile.py,sha256=T23B_o4lzx2fsPdL9wt74IwzR2yQNQDdH9gAT47soMg,1817
|
|
18
|
+
aibi_toolkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
aibi_toolkit/report.py,sha256=jw2MDsO0VWw7RZkJ5P-koZJOqzQHo8q6ayFVWsfes6E,2590
|
|
20
|
+
aibi_toolkit/sample.py,sha256=7HT4_wunAM0IenP9Ytxt2Au9UqcUvUH_mfQJL2xD8gY,1754
|
|
21
|
+
aibi_toolkit/tables.py,sha256=KfKYNno34ELLB4Akqz3fujonrU0MvFj67oRD0veSE8Y,1734
|
|
22
|
+
aibi_toolkit-1.2.0.dist-info/licenses/LICENSE,sha256=bTNpjseg8cGlHEyVLKHv6xsXJv9sDx17W6kJCeP9NrA,1071
|
|
23
|
+
aibi_toolkit-1.2.0.dist-info/METADATA,sha256=AF3G7pmfLMfniwj5usFeNl2u9sTs9N6scZ1LuRgyyYc,10299
|
|
24
|
+
aibi_toolkit-1.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
25
|
+
aibi_toolkit-1.2.0.dist-info/entry_points.txt,sha256=we8jCcz6JHxc36QIzmIgscvXHN3BvJPUn0HKkOU64lM,47
|
|
26
|
+
aibi_toolkit-1.2.0.dist-info/top_level.txt,sha256=Gyp51XoNIxNPH42zNWNz3FvSpWiIGC-y-NBhXqypka0,13
|
|
27
|
+
aibi_toolkit-1.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sourin Rakshit
|
|
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 @@
|
|
|
1
|
+
aibi_toolkit
|