Add types for openpyxl for mypy.
$ pip install openpyxl-stubs
Mypy will automatically use the type annotations in this package, once it is installed. You just need to annotate your code:
from typing import Optional from flask_httpauth import HTTPAuth, Authorization def foo(bar: HTTPAuth) -> Optional[Authorization]: return bar.get_auth()
For general hints how to use type annotations, please read Type Annotations in Python 3.8