ty
ty is a fast static type checker and language server for Python, written in Rust and designed for quick feedback in editors and CI.
Installation and Setup
Install into an active virtual environment:
Key Features
- Static analysis with a Rust core and parallel checking.
- Editor integration through the Language Server Protocol with an official Visual Studio Code extension and documented Neovim and Zed setups.
- Focused CLI with a watch mode for incremental checks and rapid feedback.
- First-party and third-party import discovery from your Python environment, including automatic
.venvandVIRTUAL_ENVdetection. - Declarative configuration in
pyproject.tomlorty.toml, including rule levels, source include and exclude globs, and target Python and platform settings. - CI-friendly output formats for GitHub and GitLab, plus exit-code control for pipelines.
Usage
Run type checks for the current project:
$ ty check
Check specific paths:
$ ty check src/ tests/
Watch for changes and recheck related files:
$ ty check --watch
Target a Python version and platform for resolution and rule selection:
$ ty check --python-version 3.12 --python-platform linux
Configure once in your project:
# pyproject.toml
[tool.ty]
python-version = "3.14"
[tool.ty.src]
include = ["src", "tests"]
exclude = ["src/generated"]
[tool.ty.rules]
redundant-cast = "ignore"
possibly-missing-import = "error"
Related Resources
Tutorial
Astral's ty: A New Blazing-Fast Type Checker for Python
Learn to use ty, an ultra-fast Python type checker written in Rust. Get setup instructions, run type checks, and fine-tune custom rules in personal projects.
For additional information on related topics, take a look at the following resources:
By Leodanis Pozo Ramos • Updated Dec. 1, 2025