Repolode
meta

meta/pyrefly

A fast Python type checker and language server, written in Rust, with IDE features like navigation, completion and semantic highlighting.

Open-source alternative to:MypyPyright

Stars
7,186
Forks
590
Open issues
589
Last commit
23 hours ago

What is it?

Pyrefly is a type checker and language server for Python. It runs as a command-line tool that checks code for type errors, and as an extension for editors such as VS Code, Neovim and Zed that provides code navigation, autocomplete, hover information, inlay hints and semantic highlighting.

The project focuses on speed on large codebases. The README reports it checking PyTorch substantially faster than Mypy and Pyright, and IDE rechecks completing in under 10 milliseconds after a save. It includes built-in support for Pydantic, Django and pytest.

For existing projects, Pyrefly offers commands to migrate from Mypy or Pyright (`pyrefly init`), suppress current errors (`pyrefly suppress`) and generate type annotations (`pyrefly infer`), so teams can adopt it one file at a time.

Key features

  • 01Type checks Python code from the command line at high speed on large projects.
  • 02Language server provides code navigation, autocomplete, hover and inlay hints.
  • 03Built-in support for Pydantic, Django and pytest.
  • 04Migration commands for projects coming from Mypy or Pyright.
  • 05Can silence existing errors and infer type annotations for gradual adoption.

Use cases

  • Adding static type checking to a large Python codebase in CI.
  • Getting type-aware autocomplete and navigation in VS Code, Neovim or Zed.
  • Migrating a project from Mypy or Pyright with minimal disruption.
  • Type checking Django or pytest projects with framework-aware support.

Quick start

  1. 1

    Install the command-line tool with pip

    pip install pyrefly
  2. 2

    Install the IDE extension from the IDE installation page

Things to know

  • Version policy allows any release, including patch versions, to introduce new type errors and breaking changes.

Topics

FAQ

What is pyrefly?
A fast Python type checker and language server, written in Rust, with IDE features like navigation, completion and semantic highlighting. Pyrefly is a type checker and language server for Python. It runs as a command-line tool that checks code for type errors, and as an extension for editors such as VS Code, Neovim and Zed that provides code navigation, autocomplete, hover information, inlay hints and semantic highlighting.
Is pyrefly free to use? What license does it have?
pyrefly is open source under the MIT license. Check the license terms before using it in commercial products.
Is pyrefly still maintained?
Actively maintained. The last commit to pyrefly was on Nov 6, 2026.
What can I use pyrefly for?
Adding static type checking to a large Python codebase in CI. Getting type-aware autocomplete and navigation in VS Code, Neovim or Zed. Migrating a project from Mypy or Pyright with minimal disruption. Type checking Django or pytest projects with framework-aware support.
How do I install pyrefly?
Install the command-line tool with pip: pip install pyrefly Install the IDE extension from the IDE installation page
Where can I get pyrefly?
The source code and installation instructions are on GitHub: https://github.com/meta/pyrefly

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects