Python

Python Type Hint Coverage Checker

Reports annotation coverage per function and names the parameters and returns that have none.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the module, or load a .py file with the picker.
  2. Select Check the coverage.
  3. Work down the "unannotated parameters" column — each name in it is one annotation away from being done.
  4. Run it again after your changes; the percentage in the summary is the progress.

What python type hint coverage does

Adding type hints to an existing codebase is a long job done one module at a time, and the hard part is knowing where you are. This page reads a module and reports, function by function, which parameters carry an annotation, whether the return type is declared, and what the coverage adds up to. Run it before you start and again afterwards and the difference is the work you did.

The counting rules are the ones a reviewer would use. self and cls are ignored, because annotating them is not the convention and including them would understate every method. Positional-only and keyword-only markers are not parameters and are not counted. A default value containing a colon — a dict literal, say — does not count as an annotation, which is the case a naive check gets wrong. Nothing is executed and no imports are resolved: this reports whether an annotation is present, not whether it is correct, which is the job of a type checker run against the whole project.

Frequently asked questions

Because annotating them is not the convention and every type checker infers them anyway. Counting them would understate the coverage of every method in every class by one parameter, which would make the percentage useless for tracking progress — the number would move for reasons that have nothing to do with the work you did.

No. This reports whether an annotation is present, not whether it is true. Checking correctness means resolving imports and following types across the whole project, which is what mypy or pyright do and what nothing running purely in a browser tab can do honestly. Use this to find the gaps, then run a real type checker over what you have annotated.

It is handled. A default like {"a": 1} contains a colon that is nothing to do with annotation, and a naive check counts it as one. Here the parameter list is split on commas that are outside brackets, and only a colon appearing before the equals sign is treated as an annotation, so a dict default is correctly reported as unannotated.