Skip to main content

A static code analyzer & language server for Python

Project description

pylyzer ⚡

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

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
  • 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
    • Iterable
    • Iterator
    • Mapping
    • Sequence
    • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pylyzer-0.0.69-py3-none-win_amd64.whl (14.2 MB view details)

Uploaded Python 3 Windows x86-64

pylyzer-0.0.69-py3-none-win32.whl (11.9 MB view details)

Uploaded Python 3 Windows x86

pylyzer-0.0.69-py3-none-musllinux_1_2_x86_64.whl (12.5 MB view details)

Uploaded Python 3 musllinux: musl 1.2+ x86-64

pylyzer-0.0.69-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

pylyzer-0.0.69-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (13.9 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ i686

pylyzer-0.0.69-py3-none-macosx_11_0_arm64.whl (11.3 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

File details

Details for the file pylyzer-0.0.69-py3-none-win_amd64.whl.

File metadata

  • Download URL: pylyzer-0.0.69-py3-none-win_amd64.whl
  • Upload date:
  • Size: 14.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pylyzer-0.0.69-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0e1d7636c5a49f61fa6ffa933a1ed887d89158ffe1b55eb18a019e4a6eaedb78
MD5 6bb0158629988648f2c82e98525bc3ef
BLAKE2b-256 aa82884281c44bea268df9b4e2a2440f990a50b70b125d215556a4af792399fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-win_amd64.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

Details for the file pylyzer-0.0.69-py3-none-win32.whl.

File metadata

  • Download URL: pylyzer-0.0.69-py3-none-win32.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pylyzer-0.0.69-py3-none-win32.whl
Algorithm Hash digest
SHA256 262fca5823309067ec994c304b23a3b348b16fad5fe4fbe7f24a32edd902f90f
MD5 fcd63cf2e30a357af886cc11b1f9c0f4
BLAKE2b-256 e7958d66785cf94f5942612dff5e36c64d8b16600538fdd1399b93d86729bb11

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-win32.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

Details for the file pylyzer-0.0.69-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.69-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0fe8cfdd1f5208196ff0100d05fc176cc1c1cd17dbbacac42aca96f903305295
MD5 a21d63c658008eaf1a415f9405e63eac
BLAKE2b-256 5a7f5e29ddf22fc8f306fb8144f10bf6c080208cd1b2251e7163ef2830ccd68c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

Details for the file pylyzer-0.0.69-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.69-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e2b11206d3bc891603888d30479061827a8015860af1e8c1e21f01e737648bb
MD5 5bda43f00cc8968a3cdb315e177fcdf9
BLAKE2b-256 2bac0c77eb7ce690e9ca2e76d67d107a089f0893b886d883fd6a603a4644c842

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

Details for the file pylyzer-0.0.69-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.69-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3096856e53d922c5aabf0d3525ce550016b62162dce8985421250917a27100dc
MD5 0878ffcd4a02ba64b65fdbdf5e4ef865
BLAKE2b-256 43068798cea033bedf0d42e62deaf48b368e96be7f7127903e8425e6ada50d53

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

Details for the file pylyzer-0.0.69-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.69-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 662f5a1f69083c9128dab7cbeb588c184f32c2fb3406de2c103db36914ef82d8
MD5 563593c35f8def82ec6245f7083ad013
BLAKE2b-256 6293bed826fdd7e8365df5635d2105beef133fd7448c9b95e34c842d7ffaf1f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.69-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on mtshiba/pylyzer

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page