https://github.com/martinthoma/flask-httpauth-stubs
Type stubs for Flask-HTTPAuth
https://github.com/martinthoma/flask-httpauth-stubs
flask-httpauth mypy python stubs types typing
Last synced: about 1 year ago
JSON representation
Type stubs for Flask-HTTPAuth
- Host: GitHub
- URL: https://github.com/martinthoma/flask-httpauth-stubs
- Owner: MartinThoma
- License: mit
- Created: 2020-10-04T06:30:07.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-11-05T10:30:26.000Z (over 2 years ago)
- Last Synced: 2025-04-09T20:44:39.664Z (about 1 year ago)
- Topics: flask-httpauth, mypy, python, stubs, types, typing
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/Flask-HTTPAuth-stubs)
[](https://github.com/MartinThoma/Flask-HTTPAuth-stubs)
[](https://github.com/psf/black)

# Flask-HTTPAuth-stubs
Add types for [Flask-HTTPAuth](https://pypi.org/project/Flask-HTTPAuth/) for mypy.
## Installation
```
$ pip install flask-httpauth-stubs
```
## Usage
Mypy will automatically use the type annotations in this package, once it is
installed. You just need to annotate your code:
```python
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](https://medium.com/analytics-vidhya/type-annotations-in-python-3-8-3b401384403d)