Code Quality Tools in Python

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Access the most powerful time series database as a service
  • Sonar - Write Clean Python Code. Always.
  • SaaSHub - Software Alternatives and Reviews
  • pycodestyle

    Simple Python style checker in one Python file

    Linters analyze code to detect various categories of issues like logistical issue and stylistic issues. Some popular linters are Pylint, pycodestyle, Flake8 and Pylama.

  • pyflakes

    A simple program which checks Python source files for errors

    Flake8: a combination of following linters: PyFlakes, pycodestyle, Ned Batchelder’s McCabe script

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • mccabe

    McCabe complexity checker for Python

    Flake8: a combination of following linters: PyFlakes, pycodestyle, Ned Batchelder’s McCabe script

  • pylama

    Code audit tool for python.

    Linters analyze code to detect various categories of issues like logistical issue and stylistic issues. Some popular linters are Pylint, pycodestyle, Flake8 and Pylama.

  • pydocstyle

    docstring style checker

    pydocstyle

  • black

    The uncompromising Python code formatter

    as per the black's documentation, Black is "The uncompromising Python code formatter". It is my personal favourite because it has minimal configuration and is fast enough. Black is used by some very popular open-source projects, such as pytest, tox, Pyramid, Django Channels, Poetry, and so on. Example usage:

  • yapf

    A formatter for Python files

    YAPF (Yet Another Python Formatter) is Google's official python formatter which follows google's style guide. The documentation is easy to understand the installation and configuration for this formatter.

  • Sonar

    Write Clean Python Code. Always.. Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.

  • isort

    A Python utility / library to sort imports.

    Formatters automatically format your code based on a style guide. Some popular formatters are Black, YAPF, autopep8 and isort.

  • autopep8

    A tool that automatically formats Python code to conform to the PEP 8 style guide.

    autopep8 is an unofficial, yet popular, tool that automatically formates Python code to conform to PEP 8. It uses pycodestyle, Python’s official PEP-8 violation checker tool, to determine what parts of the code need to be formatted.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts