Skip to main content

aibi-toolkit

aibi — CLI + library for cleaning up Power BI / Tableau semantic-model metadata. Companion to aibi-dax: where aibi-dax checks the DAX expressions inside your measures, aibi-toolkit checks the model around them — naming conventions, format strings, duplicate measures, empty tables, relationships, hygiene.

CI Lint Python Types Ruff Docs License

Runnable walkthroughs live in examples/.

Why this exists

A semantic model is a shared asset, and it always drifts. Measure names pick up stray spaces, missing format strings, duplicate definitions that nobody deletes, and DAX smells that pass casual review. Nobody catches it, because each file is small but the model is large, and nobody wants to be the one recounting the measures by hand.

That is the failure mode aibi-toolkit was built for. It reads the dump, runs the checks, gives you a score, and names the findings. The first pass usually looks like: score 38, a dozen missing format strings, six duplicate measures.

What it does

  • aibi audit — measure hygiene findings and a 0-100 score. Checks format strings, case-insensitive duplicate names, and measure name length. Exit 1 when anything is found, 0 when the model is clean, so a CI gate is one command.
  • aibi lint — static checks on the DAX expressions: raw / without DIVIDE, no-argument ALLSELECTED(), CALCULATE([]), and IFERROR masking.
  • aibi fix — applies naming and format-string fixes with --dry-run so you always see what would change before it changes.
  • aibi summary — object counts; aibi tables — table list.
  • aibi report — markdown audit report: score, finding counts, examples, for your own paper trail or a PR description.
  • aibi diagram — mermaid ER diagram straight from the model.
  • aibi profile — expression complexity: count, average, max weight, and the heaviest measures named.
  • aibi synth — generate a sample model for trying the tool.
  • aibi export — measures to CSV for external row-checks.

Full module map:

Area Module
Naming naming
Format strings measure
DAX snippets dax, filters
Model inspection metadata
Auditing + linting audit, lint
Integrity integrity
Autofixes autofix
Diagrams diagram
Reports report
Demo data sample
Renderers tables
Configuration config
Profiling profile
CSV round-trip csvio

Install

Install from PyPI and check the binary works:

pip install aibi-toolkit
aibi --help

Or install from the source tree: git clone https://github.com/SourinRakshit-ai/aibi-toolkit.git && cd aibi-toolkit && pip install ..

Quick start

Generate a sample model, then check it:

aibi synth model.json          # write a sample model
aibi summary model.json        # object counts
aibi audit model.json          # hygiene findings + 0-100 score
aibi lint model.json           # DAX rule findings
aibi audit model.json --json   # machine-readable output (also: lint, profile)
aibi report model.json out.md  # markdown audit report
aibi fix --dry-run model.json  # preview fixes before writing anything

Audit returns exit 1 when findings exist, 0 when clean, so a pipeline that already has set -e fails immediately. Pass --json to audit, lint or profile when you want a machine-readable result.

How it helps

  • One number first. The 0–100 score tells you whether the model deserves attention before you read a single measure. Score 38 usually means "regenerate formats and delete the dead duplicates"; score 92 means "quick answer, move on".
  • Names and formats are the fix. Around 90% of findings in real models are missing_format and duplicates after a bulk edit; both are auto-fixable by aibi fix with --dry-run for confirmation.
  • Exit codes mean CI. aibi audit model.json returns 1 with any finding and 0 clean, so the release pipeline it belongs in fails where the merge should wait for you.
  • The report is the artifact. aibi report gives a reviewer the score and a short list of examples, which is usually enough for the release meeting.

What it is not

  • Not an aibi-dax substitute. It lints DAX for narrowly-scoped patterns (raw /, no-arg ALLSELECTED(), CALCULATE([]), IFERROR hiding). For deep complexity scoring and anti-pattern detection, that is what aibi-dax is for.
  • Not a full TMDL/PBIP authoring tool. It reads shared-schema model dumps; it does not write them back to disk yet (tracked in #6).
  • Not a bug finder for DAX logic. It checks static patterns; it cannot tell you your total is wrong. That still needs EVALUATE checks and your eyes.
  • Not a performance tool. It has no cost model for queries; it flags patterns, not benchmarks.

Commands

Command Purpose
aibi summary model.json object counts
aibi tables model.json list tables
aibi audit model.json hygiene findings + 0-100 score
aibi lint model.json DAX rule findings
aibi fix --dry-run model.json preview naming/format fixes (omit --dry-run to apply)
aibi profile model.json expression complexity: count, avg, max, heavy
aibi diagram model.json mermaid ER diagram
aibi export model.json out.csv measures to CSV
aibi report model.json out.md markdown audit report
aibi synth model.json generate a sample model

Docs and support

Development

make install        # pip install -e ".[dev]"
make test           # pytest -q
make typecheck      # mypy --strict src/aibi_toolkit/
make lint           # ruff check src/ tests/
make serve-docs     # mkdocs serve

MIT licensed. Roadmap lives in the issue tracker.

Metadata

Release files for aibi-toolkit 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aibi-toolkit 1.2.1
File Size Uploaded Provenance Actions
aibi_toolkit-1.2.1.tar.gz 28.0 kB With provenance Details for aibi_toolkit-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aibi-toolkit 1.2.1
File Interpreter ABI Platform Actions
aibi_toolkit-1.2.1-py3-none-any.whl Python 3 none any Details for aibi_toolkit-1.2.1-py3-none-any.whl

Total release size: 53.3 kB

Release files / aibi_toolkit-1.2.1.tar.gz

Download URL aibi_toolkit-1.2.1.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6152a0fc212b3fa244a2adf83bf233a5dc88dfceb4a950a64594d77581a801e8
BLAKE2b-256 checksum
How to use checksums
83965956f23533e96cf6b29f32f10841b29c34e0e8d9254218864cc1091c877c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / aibi_toolkit-1.2.1-py3-none-any.whl

Download URL aibi_toolkit-1.2.1-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5378d3fbb64702ad5f4fafe3ac56c5ad7729450e2699bd2ba816ecc2aef93d39
BLAKE2b-256 checksum
How to use checksums
ceb3671788961e9e338e1e66889b954417429adc70dc7923585412aafe8d2ec1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for aibi-toolkit 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aibi_toolkit-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page