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
Since ty is made by Astral, the team behind uv, the recommended way to install it is with uv. Run ty without installing it:
$ uvx ty check
Add it to a project as a development dependency:
$ uv add --dev ty
Or install it globally as a standalone tool:
$ uv tool install ty@latest
Alternatively, install ty into an active virtual environment with pip:
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:
- Python Type Checking (Course)
- Ruff: A Modern Python Linter for Error-Free and Maintainable Code (Tutorial)
- Astral's ty Type Checker for Python (Quiz)
- Modern Python Linting With Ruff (Course)
- Ruff: A Modern Python Linter (Quiz)
By Leodanis Pozo Ramos • Updated July 6, 2026