xpd
xpd is a fast static analyzer, API search engine, and recorded review workbench for Python codebases, data pipelines, and coding agents. Run uvx xpd check . to catch slow or wrong library calls without running Python, or run uvx xpd audit . for a unified read-only health report across linter rules, static review workflows, --since regression deltas, and recorded ledger debt.
Read the full documentation at https://bjoernaagaard.github.io/xpd/.
flowchart LR
Code["Python, TSX, and Rust files"] --> Lint["Lint and audit (xpd check, audit, hook, lsp)"]
Code --> Search["Search bundled and project APIs (xpd find, api, library)"]
Code --> Ledgers["10 recorded review ledgers (code quality, data, ML, charts)"]
Code --> Proof["Dataflow and proof (xpd graph, profile, equiv, refit, gates)"]
Code --> Agent["Agent and media tools (xpd mcp, plugin, animate)"]
xpd ships rule packs and symbol indexes for pandas, Polars, NumPy, SciPy, scikit-learn, skrub, Feature-engine, scikit-lego, glum, quantile-forest, MAPIE, skore, Optuna, Optuna Integration, Category Encoders, LightGBM, XGBoost, statsmodels, linearmodels, arch, CVXPY, skfolio, pymoo, Nixtla forecasting libraries, plotly, Apache Hamilton, and core Python.
Install
xpd requires Python 3.13 or newer. Install it once with uv, or invoke any command directly with uvx xpd.
uv tool install --python '>=3.13' xpd
Check and fix a file
Save bad.py in an empty folder. xpd parses the source statically, so you do not need pandas installed.
import pandas as pd
df = pd.DataFrame({"a": [1, 2], "k": [1, 2]})
other = df.copy()
for i, row in df.iterrows():
df["a"][i] = row["a"] * 2
df.dropna(inplace=True)
m = pd.merge(df, other, on="k")
out = pd.DataFrame()
for f in ["x.csv"]:
out = pd.concat([out, pd.read_csv(f)])
Run xpd check bad.py --format text. Terminal runs default to text, and piped runs default to JSON.
$ xpd check bad.py --format text
bad.py:5:15: warning [pandas/row-loop] iterrows() builds a Series for every row. Compute on whole columns instead, such as df["a"] * df["w"]. When each row has to become a Python object, loop over itertuples() or to_dict("records").
bad.py:6:5: error [pandas/chained-assignment] Chained assignment writes to a copy under copy-on-write, so the frame keeps its old values. Assign to df.loc[i, "a"] instead.
bad.py:7:1: info [pandas/no-inplace] inplace=True gives no speedup and blocks chaining. Reassign instead.
bad.py:8:5: warning [pandas/merge-without-validate] merge without validate= can silently duplicate rows.
bad.py:11:5: warning [pandas/concat-in-loop] out grows by one concat per pass, and each concat copies every earlier row. Collect the frames in a list and concat once after the loop.
xpd: 5 issues, 2 more with --fix --unsafe-fixes
| Severity | Meaning | Exit code |
|---|---|---|
error |
Code gives a wrong result or raises an exception | 1 |
warning |
Code is slow or easy to get wrong | 0 |
info |
A shorter or newer form exists | 0 |
Apply safe rewrites with --fix. Add --unsafe-fixes when you accept fixes that can change runtime behavior, and review the diff afterwards.
$ xpd check bad.py --fix --unsafe-fixes --format text
...
xpd: fixed 2, 3 issues
for i, row in df.iterrows():
- df["a"][i] = row["a"] * 2
-df.dropna(inplace=True)
+ df.loc[i, "a"] = row["a"] * 2
+df = df.dropna()
Set style = "strict" in [tool.xpd] of pyproject.toml or in ~/.config/xpd/config.toml to promote house style info rules to warnings. See xpd check for details.
Audit a repository in one command
Run xpd audit for a read-only rollup of xpd check, static ledger workflows (untangle, harden, optimize, discover, or --workflows all), --since regression counts, and recorded ledger debt. Add --fail-on-regression in CI or local gates to exit 1 when new issues appear.
xpd audit src/ --since HEAD~1 --fail-on-regression
Commands at a glance
Run xpd <command> -h or read the command reference for every option and exit status.
| Area | Commands | What they do |
|---|---|---|
| Lint, audit, and editors | check, audit, rules, hook, lsp |
Lint files, aggregate read-only audits with --since regression gating, guard agent edits, and serve editor diagnostics plus workspace structural hints |
| Code quality ledgers | untangle, optimize, harden, discover |
Audit coupling (--map for Python and Rust, --move, --inline-facade), measured CPU or memory waste, silent failures or flaky tests, and search-unfriendly names |
| Data and ML ledgers | data-prep, ts-review, feature-review, model-review, opt-review, chart-review |
Audit ingestion and scaling, time series diagnostics, feature lift, model validation, numerical solvers, and Tufte/Cleveland/Wilke charts or tables |
| Library lookup | find, api, library, index |
Search bundled and project-local [tool.xpd.libraries] symbols, rules, and playbooks with semantic and keyword ranking |
| Dataflow and proof | graph, graph map, graph impact, profile, equiv, refit, gates |
Trace dataflow, plan pandas to Polars migrations, profile files, and prove refactors or model refits |
| Authoring and media | rules new, rules test, rules run, rules outline, animate |
Author custom ast-grep rules, map modules, and render editable Manim animations with animate catalog and --profile draft |
| Integrations | mcp, doctor, skill, completions |
Run the 14-tool MCP server, Ruff and ty profile doctor, bundled agent skills, and shell completions |
Connect agents and editors
Install the xpd plugin in Claude Code or Codex to enable edit hooks, 14 MCP tools, and all 3 bundled skills in one step.
claude plugin marketplace add bjoernaagaard/xpd
claude plugin install xpd@xpd
| Goal | Setup | Guide |
|---|---|---|
| Guard every agent edit with hooks, MCP, and skills | Install the Claude Code or Codex plugin | Claude Code and other agents |
| Install only the agent skills | npx skills add bjoernaagaard/xpd |
Agent skills |
| Add visual MCP Apps, ledger views, and model gates | claude mcp add xpd -- uvx xpd mcp |
Connect an agent with MCP |
| Index internal or third-party project libraries | xpd library add <package> |
Index project libraries |
| Run a unified read-only repository audit | xpd audit src/ --since main |
Audit a repository |
| Lint, quick-fix, and view workspace hints in an editor | Configure xpd lsp |
Use xpd in an editor |
| Refactor coupling or render Manim animations | xpd untangle or xpd animate |
Untangle and Animate |
License
You may use xpd under MIT or Apache-2.0. Bundled recipes and dependencies keep their own licenses in licenses/.
| Component | License | Location |
|---|---|---|
xpd source and playbooks |
MIT or Apache-2.0 | LICENSE-MIT, LICENSE-APACHE |
| Library recipes | Library license (MIT, BSD-3-Clause, Apache-2.0, or NCSA) | licenses/ (xpd api <recipe> prints license and source) |
| Manim Community API index | MIT | Manim Community, 3Blue1Brown |
option-ext |
MPL-2.0 | licenses/option-ext-LICENSE.txt, licenses/option-ext-0.2.0-source.tar.gz |
libcst |
MIT and PSF-2.0 | licenses/libcst-LICENSE |
EmbeddingGemma (xpd find download) |
Gemma Terms of Use (https://ai.google.dev/gemma/terms) | Downloaded on first xpd find, not shipped |
Metadata
Release files for xpd 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xpd-1.2.0.tar.gz | 10.5 MB | Without provenance | Details for xpd-1.2.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| xpd-1.2.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for xpd-1.2.0-py3-none-win_amd64.whl |
| xpd-1.2.0-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details for xpd-1.2.0-py3-none-musllinux_1_2_x86_64.whl |
| xpd-1.2.0-py3-none-musllinux_1_2_aarch64.whl | Python 3 | none | Linux musl 1.2+ ARM64 | Details for xpd-1.2.0-py3-none-musllinux_1_2_aarch64.whl |
| xpd-1.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for xpd-1.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| xpd-1.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for xpd-1.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| xpd-1.2.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for xpd-1.2.0-py3-none-macosx_11_0_arm64.whl |
Total release size: 209.2 MB
Release files / xpd-1.2.0.tar.gz
| Download URL | xpd-1.2.0.tar.gz |
|---|---|
| Size | 10.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bd6989a914e8195070da97a92070931622a5e4858be2f2ca4747ce1caae56bc
|
|
BLAKE2b-256 checksum How to use checksums |
cf92b17508410e307367d17ab7d7155133b84205ab491e2063b0da6901461668
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-win_amd64.whl
| Download URL | xpd-1.2.0-py3-none-win_amd64.whl |
|---|---|
| Size | 32.8 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cbd3d28046379ce4192e43f743de0bac066d734d2ad6186e1d89c4913c20917e
|
|
BLAKE2b-256 checksum How to use checksums |
d4358576b60925f6e54ed8564ddc861c9396a909c178ff009abc3e91378ab92e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-musllinux_1_2_x86_64.whl
| Download URL | xpd-1.2.0-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 33.0 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
a217211bcd2ff2c6c10cc589be516415ba44b9ad5e4113a72fb06ccfd48693eb
|
|
BLAKE2b-256 checksum How to use checksums |
b7af8835b662066f481542976df3db41946c1495af9238ddbf38f0fe94bfe603
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-musllinux_1_2_aarch64.whl
| Download URL | xpd-1.2.0-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 32.2 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
0d1b85583215e2492c39317864635cc70a89a92bc1a5c2fb869f1fbdd6ebceea
|
|
BLAKE2b-256 checksum How to use checksums |
f078996a855377aea11a53f15d922f543685660f8aa654a5de7ca5784cc30760
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | xpd-1.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 33.8 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
a821f94007a19d327baa71b399fd5ae19418d43a3cae677c99d47e552e1062ea
|
|
BLAKE2b-256 checksum How to use checksums |
2d05364ed82b293de8548eb8697c1a9bb5240200936b700c249af2f5775f6387
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | xpd-1.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 32.8 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
c134c59835e03a9985d33b3958a061d144cdc1b38aceb7f65417768083b6e7c5
|
|
BLAKE2b-256 checksum How to use checksums |
59b9910aab435d4ec81f32c6771a991e6b71f342ef72901122814541272c034c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / xpd-1.2.0-py3-none-macosx_11_0_arm64.whl
| Download URL | xpd-1.2.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.1 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b4c7031106beb74af0d2880164e859810e1a0e46fcdf41d3defec57feeea5ad2
|
|
BLAKE2b-256 checksum How to use checksums |
afa83b138b791bf34eab0536255cfa74d673a03189d701337640203710240052
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for xpd 1.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.