Standard Library
The Python standard library includes a wide variety of tools for many different purposes. We’ve already seen and worked with some of them, including math, sys, csv, gzip, and others.
The standard library contains modules for operating system functions, debugging, profiling and unit testing, graphical interfaces and multimedia services, internet protocols and data handling, and many more.
Python has a Packaging Index where you can find up-to-date information about Python packages. There is also a website where you can look up various frameworks and libraries. It’s called Awesome Python.
Code Linters
We mentioned code style earlier. There are a number of tools you can use to check and enforce code style. Arguably the most popular are the pylint, pycodestyle and flake8 command-line tools for linting your code based on PEP 8.
These tools are configurable so that if you want to make your own exceptions to the PEP8 standards for code style, you can make those adjustments locally. Many code editors can be configured to run the linter live, so you have immediate feedback as you type your code.
If you use type hints in your code (introduced in 3.5), you can use a tool mypy to do a static analysis of the code to see if there are obvious places where variable types are not consistent.
Recently it has become popular to use a code formatter called Black. It reformats your Python code based on strict rules. One comment is “Black is opinionated so you don’t have to be.” It does provide some customization but mostly relies on sensible defaults and strong opinions.