mtshiba/pylyzer

Rustmtshiba.github.io/pylyzer/
macOSWindowsLinux

대체: Pyright

A fast, feature-rich static code analyzer & language server for Python

language-serverpythonstatic-analysistype-checkerrust
스타 성장
스타
2.9k
포크
43
주간 성장
+-1
이슈
8
1k2k
2022년 12월2024년 3월2025년 6월2026년 9월
아티팩트crates.io
README

pylyzer ⚡

[!IMPORTANT] pylyzer is now under the maintenance phase, which means that only bug fixes will be made and no new features will be added. The author is currently cooperating with the development of astral-sh/ty. Please try that instead!

pylyzer_logo_with_letters

vsm-version Build status Build status

pylyzer is a static code analyzer / language server for Python, written in Rust.

Installation

pip

pip install pylyzer

cargo (Rust package manager)

cargo install pylyzer --locked

build from source

git clone https://github.com/mtshiba/pylyzer.git
cargo install --path . --locked

Make sure that cargo/rustc is up-to-date, as pylyzer may be written with the latest (stable) language features.

GitHub Releases

How to use

Check a single file

pylyzer file.py

Check multiple files

# glob patterns are supported
pylyzer file1.py file2.py dir/file*.py

Check an entire package

If you don't specify a file path, pylyzer will automatically search for the entry point.

pylyzer

Start the language server

This option is used when an LSP-aware editor requires arguments to start pylyzer.

pylyzer --server

For other options, check the manual.

What is the advantage over pylint, pyright, pytype, etc.?

  • Performance 🌟

On average, pylyzer can inspect Python scripts more than 100 times faster than pytype and pyright 1. This is largely due to the fact that pylyzer is implemented in Rust.

performance

  • Reports readability 📖

While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.

pyright

pyright_report

pylyzer 😃

report

  • Rich LSP support 📝

pylyzer as a language server supports various features, such as completion and renaming (The language server is an adaptation of the Erg Language Server (ELS). For more information on the implemented features, please see here).

lsp_support

autoimport

VSCode extension

You can install the VSCode extension from the Marketplace or from the command line:

code --install-extension pylyzer.pylyzer

What is the difference from Ruff?

Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker & language server. pylyzer does not perform linting & formatting, and Ruff does not perform type checking.

How it works

pylyzer uses the type checker of the Erg programming language internally. This language is a transpiled language that targets Python, and has a static type system.

pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.

Limitations

  • pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as exec, setattr, etc.

  • pylyzer (= Erg's type system) has its own type declarations for the Python standard APIs. Typing of all APIs is not complete and may result in an error that such an API does not exist.

  • Since pylyzer's type checking is conservative, you may encounter many (possibly false positive) errors. We are working on fixing this, but if you are concerned about editor errors, please turn off the diagnostics feature.

TODOs

  • type checking
    • variable
    • operator
    • function/method
    • class
    • async/await
    • user-defined abstract class
  • type inference
    • variable
    • operator
    • function/method
    • class
  • builtin modules analysis
  • local scripts analysis
  • local packages analysis
  • LSP features
    • diagnostics
    • completion
    • rename
    • hover
    • goto definition
    • signature help
    • find references
    • document symbol
    • call hierarchy
  • collection types
    • list
    • dict
    • tuple
    • set
  • typing
    • Union
    • Optional
    • Literal
    • Callable
    • Any
    • TypeVar
    • TypedDict
    • ClassVar
    • Generic
    • Protocol
    • Final
    • Annotated
    • TypeAlias
    • TypeGuard
    • type parameter syntax
    • type narrowing
    • others
  • collections.abc
    • Collection
    • Container
    • Generator
    • Iterable
    • Iterator
    • Mapping, MutableMapping
    • Sequence, MutableSequence
    • others
  • type assertion (typing.cast)
  • type narrowing (is, isinstance)
  • pyi (stub) files support
  • glob pattern file check
  • type comment (# type: ...)
  • virtual environment support
  • package manager support
    • pip
    • poetry
    • uv

Join us!

We are looking for contributors to help us improve pylyzer. If you are interested in contributing and have any questions, please feel free to contact us.


1 The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.

관련 저장소
oraios/serena

A powerful MCP toolkit for coding, providing semantic retrieval and editing capabilities - the IDE for your agent

PythonPyPIMIT Licenseagentai
oraios.github.io/serena
29k2k
neovim/nvim-lspconfig

Quickstart configs for Nvim LSP

LuaApache License 2.0vimnvim
13.9k2.5k
a-h/templ

A language for writing HTML user interfaces in Go.

GoGo ModulesMIT Licensetemplating-languageside-support
templ.guide
10.5k366
facebook/pyrefly

A fast type checker and language server for Python

Rustcrates.ioMIT Licensecode-qualityide
pyrefly.org
6.9k512
zigtools/zls

A language server for Zig supporting developers with features like autocomplete and goto definition

ZigMIT Licensezigzls
zigtools.org/zls/install/
5.1k447
LuaLS/lua-language-server

A language server that offers Lua language support - programmed in Lua

LuaMIT Licenselualanguage-server
luals.github.io
4.4k440
Myriad-Dreamin/tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].

Rustcrates.ioApache License 2.0formatterlsp
myriad-dreamin.github.io/tinymist
3.5k183
artempyanykh/marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.

F#MIT Licensemarkdownnotes
3.3k72
bash-lsp/bash-language-server

A language server for Bash

TypeScriptnpmMIT Licenselanguage-serverbash
2.8k154
typescript-language-server/typescript-language-server

Unofficial TypeScript & JavaScript Language Server

TypeScriptnpmOthertypescriptlanguage-server
npmjs.com/package/typescript-language-server
2.6k187
scalameta/metals

Scala language server with rich IDE features 🚀

ScalaApache License 2.0lspscalameta
scalameta.org/metals/
2.3k439
redhat-developer/vscode-java

Java Language Support for Visual Studio Code

TypeScriptnpmEclipse Public License 2.0javalanguage-server
2.3k542