{"id":13469001,"url":"https://github.com/mtshiba/pylyzer","last_synced_at":"2025-05-14T03:11:20.960Z","repository":{"id":65681654,"uuid":"577313454","full_name":"mtshiba/pylyzer","owner":"mtshiba","description":"A fast, feature-rich static code analyzer \u0026 language server for Python","archived":false,"fork":false,"pushed_at":"2025-05-10T02:10:33.000Z","size":3946,"stargazers_count":2833,"open_issues_count":31,"forks_count":39,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-05-10T03:20:50.401Z","etag":null,"topics":["language-server","python","rust","static-analysis","type-checker"],"latest_commit_sha":null,"homepage":"http://mtshiba.github.io/pylyzer/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtshiba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"mtshiba","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-12-12T13:15:29.000Z","updated_at":"2025-05-10T02:10:37.000Z","dependencies_parsed_at":"2023-02-23T04:31:09.798Z","dependency_job_id":"7c6e7440-b581-4de2-bb6d-d281e270c38d","html_url":"https://github.com/mtshiba/pylyzer","commit_stats":{"total_commits":136,"total_committers":2,"mean_commits":68.0,"dds":0.02941176470588236,"last_synced_commit":"73c05b84f0a9fdb6c2700936d6a8cf30a127d891"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtshiba%2Fpylyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtshiba%2Fpylyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtshiba%2Fpylyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtshiba%2Fpylyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtshiba","download_url":"https://codeload.github.com/mtshiba/pylyzer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253357740,"owners_count":21895920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-server","python","rust","static-analysis","type-checker"],"created_at":"2024-07-31T15:01:23.962Z","updated_at":"2025-05-14T03:11:15.951Z","avatar_url":"https://github.com/mtshiba.png","language":"Rust","funding_links":["https://github.com/sponsors/mtshiba"],"categories":["Rust","Type Checkers","python","Linting, Formatting \u0026 Type Checking","Development Tools"],"sub_categories":[],"readme":"# pylyzer ⚡\n\n![pylyzer_logo_with_letters](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/pylyzer-logo-with-letters.png)\n\n\u003ca href=\"https://marketplace.visualstudio.com/items?itemName=pylyzer.pylyzer\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"\u003e\u003cimg src=\"https://img.shields.io/visual-studio-marketplace/v/pylyzer.pylyzer?style=flat\u0026amp;label=VS%20Marketplace\u0026amp;logo=visual-studio-code\" alt=\"vsm-version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/mtshiba/pylyzer/releases\"\u003e\u003cimg alt=\"Build status\" src=\"https://img.shields.io/github/v/release/mtshiba/pylyzer.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/mtshiba/pylyzer/actions/workflows/rust.yml\"\u003e\u003cimg alt=\"Build status\" src=\"https://github.com/mtshiba/pylyzer/actions/workflows/rust.yml/badge.svg\"\u003e\u003c/a\u003e\n\n`pylyzer` is a static code analyzer / language server for Python, written in Rust.\n\n## Installation\n\n### pip\n\n```bash\npip install pylyzer\n```\n\n### cargo (Rust package manager)\n\n```bash\ncargo install pylyzer --locked\n```\n\n### build from source\n\n```bash\ngit clone https://github.com/mtshiba/pylyzer.git\ncargo install --path . --locked\n```\n\nMake sure that `cargo`/`rustc` is up-to-date, as pylyzer may be written with the latest (stable) language features.\n\n### [GitHub Releases](https://github.com/mtshiba/pylyzer/releases/latest)\n\n## How to use\n\n### Check a single file\n\n```sh\npylyzer file.py\n```\n\n### Check multiple files\n\n```sh\n# glob patterns are supported\npylyzer file1.py file2.py dir/file*.py\n```\n\n### Check an entire package\n\nIf you don't specify a file path, pylyzer will automatically search for the entry point.\n\n```sh\npylyzer\n```\n\n### Start the language server\n\nThis option is used when an LSP-aware editor requires arguments to start pylyzer.\n\n```sh\npylyzer --server\n```\n\nFor other options, check [the manual](https://mtshiba.github.io/pylyzer/options/options/).\n\n## What is the advantage over pylint, pyright, pytype, etc.?\n\n* Performance 🌟\n\nOn average, pylyzer can inspect Python scripts more than __100 times faster__ than pytype and pyright [\u003csup id=\"f1\"\u003e1\u003c/sup\u003e](#1). This is largely due to the fact that pylyzer is implemented in Rust.\n\n![performance](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/performance.png)\n\n* Reports readability 📖\n\nWhile pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.\n\n### pyright\n\n![pyright_report](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/pyright_report.png)\n\n### pylyzer 😃\n\n![report](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/report.png)\n\n* Rich LSP support 📝\n\npylyzer 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](https://github.com/erg-lang/erg/tree/main/crates/els#readme)).\n\n![lsp_support](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/lsp_support.png)\n\n![autoimport](https://raw.githubusercontent.com/mtshiba/pylyzer/main/images/autoimport.gif)\n\n## VSCode extension\n\nYou can install the VSCode extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=pylyzer.pylyzer) or from the command line:\n\n```sh\ncode --install-extension pylyzer.pylyzer\n```\n\n## What is the difference from [Ruff](https://github.com/astral-sh/ruff)?\n\n[Ruff](https://github.com/astral-sh/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 \u0026 language server.\npylyzer does not perform linting \u0026 formatting, and Ruff does not perform type checking.\n\n## How it works\n\npylyzer uses the type checker of [the Erg programming language](https://erg-lang.org) internally.\nThis language is a transpiled language that targets Python, and has a static type system.\n\npylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.\n\n## Limitations\n\n* pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as `exec`, `setattr`, etc.\n\n* 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.\n\n* 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.\n\n## TODOs\n\n* [x] type checking\n    * [x] variable\n    * [x] operator\n    * [x] function/method\n    * [x] class\n    * [ ] `async/await`\n    * [ ] user-defined abstract class\n* [x] type inference\n    * [x] variable\n    * [x] operator\n    * [x] function/method\n    * [x] class\n* [x] builtin modules analysis\n* [x] local scripts analysis\n* [x] local packages analysis\n* [x] LSP features\n    * [x] diagnostics\n    * [x] completion\n    * [x] rename\n    * [x] hover\n    * [x] goto definition\n    * [x] signature help\n    * [x] find references\n    * [x] document symbol\n    * [x] call hierarchy\n* [x] collection types\n    * [x] `list`\n    * [x] `dict`\n    * [x] `tuple`\n    * [x] `set`\n* [ ] `typing`\n    * [x] `Union`\n    * [x] `Optional`\n    * [x] `Literal`\n    * [x] `Callable`\n    * [x] `Any`\n    * [x] `TypeVar`\n    * [ ] `TypedDict`\n    * [ ] `ClassVar`\n    * [ ] `Generic`\n    * [ ] `Protocol`\n    * [ ] `Final`\n    * [ ] `Annotated`\n    * [ ] `TypeAlias`\n    * [ ] `TypeGuard`\n    * [x] type parameter syntax\n    * [x] type narrowing\n    * [ ] others\n* [ ] `collections.abc`\n    * [x] `Collection`\n    * [x] `Container`\n    * [x] `Generator`\n    * [x] `Iterable`\n    * [x] `Iterator`\n    * [x] `Mapping`, `MutableMapping`\n    * [x] `Sequence`, `MutableSequence`\n    * [ ] others\n* [x] type assertion (`typing.cast`)\n* [x] type narrowing (`is`, `isinstance`)\n* [x] `pyi` (stub) files support\n* [x] glob pattern file check\n* [x] type comment (`# type: ...`)\n* [x] virtual environment support\n* [x] package manager support\n    * [x] `pip`\n    * [x] `poetry`\n    * [x] `uv`\n\n## Join us!\n\nWe 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.\n\n* [Discord (Erg language)](https://discord.gg/kQBuaSUS46)\n    * [#pylyzer](https://discord.com/channels/1006946336433774742/1056815981168697354)\n* [GitHub discussions](https://github.com/mtshiba/pylyzer/discussions)\n\n---\n\n\u003cspan id=\"1\" style=\"font-size:x-small\"\u003e\u003csup\u003e1\u003c/sup\u003e The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.[↩](#f1)\u003c/span\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtshiba%2Fpylyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtshiba%2Fpylyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtshiba%2Fpylyzer/lists"}