mypy_baseline
Integrate mypy with existing codebase.
What it is and what it does
mypy-baseline is a CLI wrapper around mypy that lets you adopt type checking incrementally on an existing project without being overwhelmed by pre-existing violations. On first run, it records all current mypy errors into a human-readable baseline file; on subsequent runs, it filters mypy's output to show only new errors you've introduced, ignoring everything already in the baseline. This lets teams gradually improve type coverage without having to fix all historical violations at once.
The tool works by parsing mypy's stdout—no patching or monkey-patching involved—and can track which specific errors were resolved versus newly introduced, even within the same file. It supports filtering by error category and regex patterns to suppress false positives from buggy plugins, and generates progress stats to show your team's improvement over time.
Use it for:
- Adopting mypy on a large legacy codebase without requiring all existing type errors to be fixed first.
- Enforcing that new code passes type checking while allowing old code to remain untyped.
- Tracking team progress on type annotation coverage with visual stats and git history.
- Suppressing false positives from third-party mypy plugins that don't affect your actual code.
- Reviewing PRs to see exactly which type errors were introduced versus resolved in that change.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A CLI tool that captures mypy type errors as a baseline on first run, then filters out only pre-existing errors on subsequent runs to show you only new violations you've introduced.
Yes. If you want to adopt mypy on an existing project without the friction of fixing all pre-existing errors first, this is the right tool. It has no dependencies, low friction, active maintenance, permissive licensing, and solves a real adoption problem. Install it if incremental type-checking adoption is your goal.
Install
mypy-baseline on PyPI
pip
pip install mypy-baselineuv
uv add mypy-baselinepoetry
poetry add mypy-baselineInstalling mypy_baseline
Before you install
Low install friction; pure Python with no runtime dependencies. Active maintenance with recent commits and stable production status.
License in practice
MIT license (permissive); you can use, modify, and distribute freely with minimal restrictions.
Quickstart
pip install mypy-baseline
# Generate baseline from current mypy output
mypy | mypy-baseline sync
# On subsequent runs, filter to show only new errors
mypy | mypy-baseline filter
Requires Python 3.9 or later and mypy installed separately.
Verify before relying
- Whether the tool works with all mypy versions or has specific version constraints.
- How baseline merge conflicts are actually avoided in practice across team workflows.
- Performance characteristics when applied to very large codebases.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 693,611/month — #5,315 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mypy_baseline-0.7.4-py3-none-any.whl
Keywords: mypy, baseline, typing, annotations, type annotations
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
igittigittA spec-compliant .gitignore parser that matches…
permissive · top 15,000 on PyPI
pybaselinesProvides 50+ baseline correction algorithms for…
permissive · top 15,000 on PyPI
pytest-pylintIntegrates pylint code analysis into pytest,…
permissive · top 15,000 on PyPI
ydiffYdiff displays colored, incremental diffs in a…
permissive · top 15,000 on PyPI
uncalledDetects unused functions in Python projects…
permissive · top 15,000 on PyPI
detect-secretsDetects secrets (API keys, tokens, credentials)…
permissive · top 5,000 on PyPI
nb-cleannb-clean removes execution counts, metadata,…
permissive · top 15,000 on PyPI
bc-detect-secretsDetects secrets (API keys, tokens, credentials)…
permissive · top 5,000 on PyPI
refurbRefurb is a static analysis tool that scans…
copyleft · top 15,000 on PyPI
mypy-strict-kwargsA mypy plugin that enforces…
permissive · top 15,000 on PyPI