Python Code Analysis and Linter

Open-source Python projects categorized as Code Analysis and Linter

Top 13 Python Code Analysis and Linter Projects

Code Analysis and Linter
  1. mypy

    Optional static typing for Python

    Project mention: You Need Subtyping | news.ycombinator.com | 2025-03-29

    To expand on this, you could be maintaining a list of Cats, call a function which accepts a list of Animals, and that function could append a Dog without causing a type error.

    https://github.com/python/mypy/issues/4976 is an interesting discussion on this in Python: should a TypedDict be allowed where a dict argument is accepted? The basic consensus is no, because then one could modify the dict, adding keys that wouldn't be allowed in the specific TypedDict.

    But this means that often you have to do cast(dict, my_typed_dict) to be able to interop with third party libraries that (quite naturally) believed that by typing their arguments as accepting a dict, they'd be accepting all dict-like things.

  2. Judoscale

    Save 47% on cloud hosting with autoscaling that just works. Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.

    Judoscale logo
  3. scalene

    Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals

    Project mention: LLMs and Code Optimization | news.ycombinator.com | 2025-01-06

    This has been a feature of the Scalene Python profiler (https://github.com/plasma-umass/scalene) for some time (at this point, about 1.5 years) - bring your own API key for OpenAI / Azure / Bedrock, also works with Ollama. Optimizing Python code to use NumPy or other similar native libraries can easily yield multiple order of magnitude improvements in real-world settings. We tried it on several of the success stories of Scalene (before the integration with LLMs); see https://github.com/plasma-umass/scalene/issues/58 - and found that it often automatically yielded the same or better optimizations - see https://github.com/plasma-umass/scalene/issues/554. (Full disclosure: I am one of the principal designers of Scalene.)

  4. Pylint

    It's not just a linter that annoys you!

  5. MonkeyType

    A Python library that generates static type annotations by collecting runtime types (by Instagram)

    Project mention: Google lays off its Python team | news.ycombinator.com | 2024-04-27

    i can't, unfortunately, it was youtube internal code. but by the same token a lot of the performance stuff was specific optimisations for that code and would not really generalise.

    one of the current "extremely large python codebase" projects is instagram, and they do have some public repos, notably monkeytype (https://github.com/Instagram/MonkeyType) which youtube did have its own analogue of, and cinder (https://engineering.fb.com/2022/05/02/open-source/cinder-jit...). in general facebook's engineering blog is a great place to read about this sort of thing.

  6. code2flow

    Pretty good call graphs for dynamic languages

    Project mention: code tools | dev.to | 2024-10-05

    Code2flow generates call graphs for dynamic programming language. Code2flow supports Python, JavaScript, Ruby, and PHP.

  7. vprof

    Visual profiler for Python

  8. Flake8

    flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

    Project mention: Top Tools for Static Analysis Help in Your Python Projects | dev.to | 2025-03-18

    Flake8: This tool checks for style errors and simple programming mistakes.

  9. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  10. coala

    coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use.

  11. prospector

    Inspects Python source files and provides information about type and location of classes, methods etc

  12. pydeps

    Python Module Dependency graphs

  13. pylama

    Code audit tool for python.

  14. PythonBuddy

    1st Online Python Editor With Live Syntax Checking and Execution

  15. unimport

    :rocket: The ultimate linter and formatter for removing unused import statements in your code. (by hakancelikdev)

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Python Code Analysis and Linter discussion

Log in or Post with

Python Code Analysis and Linter related posts

  • You Need Subtyping

    1 project | news.ycombinator.com | 29 Mar 2025
  • Top Tools for Static Analysis Help in Your Python Projects

    6 projects | dev.to | 18 Mar 2025
  • Great things about Rust that aren't just performance

    3 projects | news.ycombinator.com | 12 Jan 2025
  • LLMs and Code Optimization

    2 projects | news.ycombinator.com | 6 Jan 2025
  • Ask HN: Are my HPC professors right? Is Python worthless compared to C?

    1 project | news.ycombinator.com | 26 Oct 2024
  • Python 3.13.0 Is Released

    11 projects | news.ycombinator.com | 7 Oct 2024
  • code tools

    2 projects | dev.to | 5 Oct 2024
  • A note from our sponsor - Judoscale
    judoscale.com | 17 Apr 2025
    Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues. Learn more →

Index

What are some of the best open-source Code Analysis and Linter projects in Python? This list will help you:

# Project Stars
1 mypy 19,191
2 scalene 12,583
3 Pylint 5,449
4 MonkeyType 4,875
5 code2flow 4,228
6 vprof 3,963
7 Flake8 3,583
8 coala 3,558
9 prospector 1,993
10 pydeps 1,914
11 pylama 1,051
12 PythonBuddy 282
13 unimport 244

Sponsored
Save 47% on cloud hosting with autoscaling that just works
Judoscale integrates with Django, FastAPI, Celery, and RQ to make autoscaling easy and reliable. Save big, and say goodbye to request timeouts and backed-up task queues.
judoscale.com