Skip to main content

pycoati

Audits Python test suites for mock smells and suspicious tests. Walks a project with tree-sitter, optionally runs pytest for collection, durations, and coverage, and emits a structured inventory: per-file and per-test counts, mock-API smells, and a per-test suspicion score.

Install

# From source (Rust)
cargo install --path .

# Or as a Python package (via maturin)
maturin develop

Usage

pycoati --help

pycoati <PATH>

Audit a project directory or a single .py file. Writes the inventory to stdout as JSON unless --output is given.

# Structured inventory to a file
pycoati . --output inventory.json

# Aligned-column terminal view
pycoati . --format pretty

# Static analysis only, no pytest subprocesses
pycoati . --static-only

Key flags: --format <json|pretty>, --output <PATH>, --tests-dir <PATH>, --static-only, --no-coverage, --top-suspicious <N>, --project-package <NAME>, --python <CMD>, --pytest-args <STR>, --member-cwd <root|member>. See pycoati --help for the full list.

Weights behind suspicion_score are documented in WEIGHTS.md.

pycoati guide [PAGE]

Prints the workflow instructions that ship inside the binary, aimed at a coding agent working through an audit. Because the pages are embedded at compile time, they always describe the inventory schema this exact build emits.

# Pick the page from the state of the current directory
pycoati guide

# Or ask for one by name
pycoati guide setup
pycoati guide analyze
pycoati guide remediate
Page Contents
setup Configuration surface, how to run the scan, where inventory.json lands.
analyze Field reference for every key in the inventory, plus the anti-pattern taxonomy and its detection heuristics.
remediate The remedy ladder, the human-approval gate, and the "do not" list.

With no argument, the page is chosen from the current directory: analyze when an inventory.json is present there, otherwise setup. remediate is never auto-selected — reach it via the analyze page's breadcrumb or by name.

The subcommand shadows a directory of the same name: if you have a ./guide directory to audit, write pycoati ./guide.

Each page ends with a single next: line, so an agent is always one command away from the right instructions. A --format pretty scan that finds candidates ends with the same breadcrumb; JSON output never carries it.

The page sources are plain markdown under docs/guide/, embedded via include_str!. tests/guide_schema_drift.rs asserts that every field name serde emits is documented on the analyze page, so a schema change cannot land without the guide being updated alongside it.

Development

# Pre-commit checks
cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings && cargo test --all-features

# Full review (fmt, clippy, tests, audit, deny)
make review

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycoati-0.2.6.tar.gz (144.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycoati-0.2.6-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

pycoati-0.2.6-py3-none-manylinux_2_28_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pycoati-0.2.6-py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file pycoati-0.2.6.tar.gz.

File metadata

  • Download URL: pycoati-0.2.6.tar.gz
  • Upload date:
  • Size: 144.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pycoati-0.2.6.tar.gz
Algorithm Hash digest
SHA256 114dfe9a503d488c465438851f070cd982e23b774e3565a51da315043352ee84
MD5 2a404e9a951fd0a8b68e8911d3561d4e
BLAKE2b-256 ba2f819b53832f381cdff361567260f638e820f3dbcd10dddb240cd0c969b9ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.6.tar.gz:

Publisher: release.yml on mojzis/pycoati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycoati-0.2.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: pycoati-0.2.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pycoati-0.2.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6d12f0079a3c163c38e4f6871b04b552e8f3e68247a4b17d12cf209160021bef
MD5 a5a7e99d47a69fb551c4920bb0d99de3
BLAKE2b-256 ed69268a51588c8f34c898abf7cbd23b45c1ede0477ad2c4e53ea7d15887e7fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.6-py3-none-win_amd64.whl:

Publisher: release.yml on mojzis/pycoati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycoati-0.2.6-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycoati-0.2.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb46d524b4e69165bc2e2e05d82f831d8f7f19eb814997e7b242abb113efb827
MD5 2e2c7a230d2d63678645fcbd339759f5
BLAKE2b-256 1cd8bc6e9040214b6f3f32756ee4178250e79208524ee8e2bebb214f7643c156

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.6-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on mojzis/pycoati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycoati-0.2.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycoati-0.2.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7e2702e307f1208ecfdf3462c7dbccd6694fa989449a02c7676186554f4469b
MD5 a7d8cb243cac36bb9ba7af87230d835f
BLAKE2b-256 39bc98196d3dc67e433568c77678fb9e4a55a7ff87516ff446c13986c32b0fdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.6-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on mojzis/pycoati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.7

4 files

This release

0.2.6 This release

4 files

0.2.5

4 files

0.2.4

4 files

0.2.3

4 files

0.2.2

4 files

0.2.1

4 files

0.2.0

4 files

0.1.0

4 files

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