A static code analyzer & language server for Python
Project description
pylyzer ⚡
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.
- Reports readability 📖
While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.
pyright
pylyzer 😃
- 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).
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pylyzer-0.0.71-py3-none-win_amd64.whl
.
File metadata
- Download URL: pylyzer-0.0.71-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05e2a6481c86348bc98e0a6c6dd81ee87843fca852639a0b96a8e75a5b6da3e3 |
|
MD5 | d0fe009e332a2a4108151d861d680d56 |
|
BLAKE2b-256 | 678cca2cbf757e1a8748366c099e224e00395c67d6e417223d011557b5097f38 |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-win_amd64.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-win_amd64.whl
- Subject digest:
05e2a6481c86348bc98e0a6c6dd81ee87843fca852639a0b96a8e75a5b6da3e3
- Sigstore transparency entry: 150243741
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylyzer-0.0.71-py3-none-win32.whl
.
File metadata
- Download URL: pylyzer-0.0.71-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c56418d78801cb00740f973659facd73d91cb8e09fc36b42728b2e435c34b8e |
|
MD5 | 79e14b3c5d42d7650557468fbeecffa0 |
|
BLAKE2b-256 | a39a064510165197550af40e2b916c880facd2920b1b6c542ee75e526920700a |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-win32.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-win32.whl
- Subject digest:
2c56418d78801cb00740f973659facd73d91cb8e09fc36b42728b2e435c34b8e
- Sigstore transparency entry: 150243699
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylyzer-0.0.71-py3-none-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: pylyzer-0.0.71-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 12.5 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374d5b18e941760df765570c941d07ef936669f5f1b670edd89ff5cee324a52d |
|
MD5 | 935d4046d492b07226fc034bfeed1f7b |
|
BLAKE2b-256 | 0603d970ca792bdd239b9ef87d7c49b15ce30a104f1f61e342539d4bc1b58c9d |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-musllinux_1_2_x86_64.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-musllinux_1_2_x86_64.whl
- Subject digest:
374d5b18e941760df765570c941d07ef936669f5f1b670edd89ff5cee324a52d
- Sigstore transparency entry: 150243718
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylyzer-0.0.71-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pylyzer-0.0.71-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.5 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013e02f3797a17de54b2e502997dc45801b06025f242af350bde8139a9a9f469 |
|
MD5 | fd976cddc40f0097afcf6180f9b6b9fa |
|
BLAKE2b-256 | 11eeb4fcc4bcdac23f26483fbac05dba4b8520da2f1667bc040e3e06651ee5d5 |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Subject digest:
013e02f3797a17de54b2e502997dc45801b06025f242af350bde8139a9a9f469
- Sigstore transparency entry: 150243708
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylyzer-0.0.71-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: pylyzer-0.0.71-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 13.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fddc3a9e4c58e35ea9f6229a7407b6c7233af796ec4410ba538434698b6a69bf |
|
MD5 | 1780e61d455449de5e0f381ffc7d8a47 |
|
BLAKE2b-256 | de1af5920846646ce7d2b8065bb35785d4c76f8ce38e460fc9649d2d9aa41dba |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-manylinux2014_i686.manylinux_2_17_i686.whl
- Subject digest:
fddc3a9e4c58e35ea9f6229a7407b6c7233af796ec4410ba538434698b6a69bf
- Sigstore transparency entry: 150243735
- Sigstore integration time:
- Predicate type:
File details
Details for the file pylyzer-0.0.71-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pylyzer-0.0.71-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 11.2 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4225b04c6a3d00d583680bce735b62d709fc5e5fbffa833e406d6085c4d084fb |
|
MD5 | 408e4451d667c2f2df175348cc322aa6 |
|
BLAKE2b-256 | 18ede90871f8853777900f4770391a636fcae5fbba2092fb125a46ccc889491a |
Provenance
The following attestation bundles were made for pylyzer-0.0.71-py3-none-macosx_11_0_arm64.whl
:
Publisher:
release.yml
on mtshiba/pylyzer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pylyzer-0.0.71-py3-none-macosx_11_0_arm64.whl
- Subject digest:
4225b04c6a3d00d583680bce735b62d709fc5e5fbffa833e406d6085c4d084fb
- Sigstore transparency entry: 150243728
- Sigstore integration time:
- Predicate type: