types-python-http-client

raw JSON →
3.3.7.20260408 verified Mon Apr 27 auth: no python

Typing stubs for the python-http-client library, enabling type checking for SendGrid's HTTP client. Current version: 3.3.7.20260408. Released as part of typeshed, updated periodically.

pip install types-python-http-client
error ModuleNotFoundError: No module named 'types'
cause Trying to import from stubs directly instead of the original library.
fix
Use correct import: from python_http_client import HTTPClient
error TypeError: 'type' object is not subscriptable
cause Using stubs with Python <3.10 that lack certain typing features.
fix
Upgrade to Python >=3.10 or use older stubs.
gotcha Stubs are for type checking only. They do not replace the runtime library python-http-client.
fix Install python-http-client separately: pip install python-http-client
breaking Changes in stubs may not match the installed version of python-http-client, leading to type errors.
fix Pin both packages to compatible versions. Check typeshed version against python-http-client version.

Minimal usage of HTTPClient with SendGrid API. Requires python-http-client installed.

from python_http_client import HTTPClient

client = HTTPClient(host='https://api.sendgrid.com', request_headers={'Authorization': 'Bearer ' + os.environ.get('SENDGRID_API_KEY', '')})
response = client.get('/v3/mail/send')
print(response.status_code)