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.70-py3-none-win_amd64.whl (14.1 MB view details)

Uploaded Python 3 Windows x86-64

pylyzer-0.0.70-py3-none-win32.whl (11.8 MB view details)

Uploaded Python 3 Windows x86

pylyzer-0.0.70-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.70-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

pylyzer-0.0.70-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (13.8 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ i686

pylyzer-0.0.70-py3-none-macosx_11_0_arm64.whl (11.2 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pylyzer-0.0.70-py3-none-win_amd64.whl
  • Upload date:
  • Size: 14.1 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.70-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 31914e5abc7ee2344d51f4b986e2b90e365e39f4af0e9cedc23917132d2b03eb
MD5 640e95e1581583b1dcc98c476abb5e9b
BLAKE2b-256 d206c198840ba392257f707e5763a7efdfc813220428aa3122d50df6af3596d8

See more details on using hashes here.

Provenance

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

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

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

File metadata

  • Download URL: pylyzer-0.0.70-py3-none-win32.whl
  • Upload date:
  • Size: 11.8 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.70-py3-none-win32.whl
Algorithm Hash digest
SHA256 1dbc2909957abab0a461af82635efa48494ff589ae216c9df03c758503451690
MD5 78076c0ad19912fccb1bdc4baecbf184
BLAKE2b-256 c8c852a52741c9a4bd05cd05c66dfc6082bb28f8cfcacea7a5a00158deb57127

See more details on using hashes here.

Provenance

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

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

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

File metadata

File hashes

Hashes for pylyzer-0.0.70-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ab9a55a5804f960bcbfbadd7f62898fc0b88bcf77a4013291924b6c9ea905463
MD5 7a118a1f3e1469785e4ef9404ade05cb
BLAKE2b-256 4ffba2a36d60978b1752c8d733093d66c65e93f287f7e43af910314e6edfffe4

See more details on using hashes here.

Provenance

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

Publisher: release.yml on mtshiba/pylyzer

Attestations:

File details

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

File metadata

File hashes

Hashes for pylyzer-0.0.70-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9a1a800da3c1b5d471879f05c7c91db12be9f1b0ace9df89951386906bf41de
MD5 2722b7678031c21e052cd2696b2ff464
BLAKE2b-256 3a03fef233a39067b47ce99a0da69a5db514cb835d6dcdbddb733a52d4c05dd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.70-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.70-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.70-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2b102ba13d88d1bc6308d2f4e5cf60f16259b86e341900a886469d9ccbf623aa
MD5 f7d6a598d061fd6cfb4b669d4c7dcf77
BLAKE2b-256 ffa42b4fe715385128821550c9bfd5207374ba913007b946f1a544b205cf6872

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.70-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.70-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pylyzer-0.0.70-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e216e5299a8881789afd93e3ee4133bf709fbcc35f4fdf0d3ab869f87ff12bd2
MD5 b0768ad12f33a90a29c9053009128938
BLAKE2b-256 c6bddf5679508812ca87d19f68bc997c3265b43eec9230d90675bf70035b1f0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylyzer-0.0.70-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