Pytype – A static type analyzer for Python code
To quickly get started with type-checking a file or directory, run the following, replacing with your input:
To set up pytype on an entire package, add the following to a file in the directory immediately above the package, replacing with the package name:
Now you can run the no-argument command to type-check the package. You can use this information to type-annotate the corresponding source file, replacing with the file’s import path:
You need a Python 2.7 or 3.5+ interpreter to run pytype, as well as an interpreter in for the Python version of the code you’re analyzing. For example, suppose you have the following directory structure and want to analyze package , which depends on package :
Here is the filled-in config file, which instructs pytype to type-check as Python 3.6 code, look for packages in and , and ignore attribute errors.
Source: github.com