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.5.tar.gz (143.5 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.5-py3-none-win_amd64.whl (1.5 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pycoati-0.2.5-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.5.tar.gz.

File metadata

  • Download URL: pycoati-0.2.5.tar.gz
  • Upload date:
  • Size: 143.5 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.5.tar.gz
Algorithm Hash digest
SHA256 36234baf2bd67dfd4766d35cdecba01c3e28ee88f45918343cd5472f4a0ec888
MD5 3a8d4d2d3bd1fd71eac0e93532bb6426
BLAKE2b-256 c59ad806a81c95cfdc3b44ccae33072cc8bfdf55dd265e037f21bdabbf6f0723

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.5.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.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: pycoati-0.2.5-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.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8a38543a31bdc9b6c3d6316a5440e0e412c66debb3866b1171545feabacbbbfa
MD5 e6692e6e86dfe55e6aa7652506911f1c
BLAKE2b-256 a7d20f3289c7de0065b9104bd089ea37429edee5ab849e69bcfef37a570094cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.5-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.5-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pycoati-0.2.5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4e018090d7e6366681a344f7d95fc0a68e5b71d53cd7c717878f362a0773b879
MD5 e7489178510a019230d180d717942922
BLAKE2b-256 c20101a6dc7299262abee95443743555b50dc5459cf4d5e346ea64274ef19b8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.5-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.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycoati-0.2.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a44cc0b137432450425f77eba43069daa6beb746780f225a76061be738b3db4b
MD5 c4fd62b69810689c821af1200f5c319d
BLAKE2b-256 13d2307043870c352e971312f74f30ccafc3b089cac2a5809c7906c0b6ff41ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycoati-0.2.5-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

0.2.6

4 files

This release

0.2.5 This release

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