Registry / type-stubs / types-authlib

types-authlib

JSON →
library1.7.2.20260827pypypi✓ verified 25d ago

This is a type stub package for the Authlib library, providing static type checking for Authlib code. As part of the typeshed project, it's automatically released up to once a day. This version of types-Authlib aims to provide accurate annotations for Authlib==1.6.9. [9, 8, 23]

pip install types-authlib
INSTALL
IMPORT
SIG · TYPES-AUTHLIB
T
types-authlib
type-stubspythonv1.7.2.20260827
Install
2.5s avg
Import
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.2.20260827 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 36MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 36MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OAuth
from authlib_stubs.integrations.flask_client import OAuth
from authlib_stubs.integrations.flask_client import OAuth

This quickstart demonstrates setting up an Authlib OAuth client using Flask integration. While it's a runtime example for Authlib, its purpose here is to show code that `types-authlib` would type-check. You must install `Authlib` (e.g., `pip install Authlib Flask`) and optionally `python-dotenv` for environment variables, in addition to `types-authlib`.

import os from flask import Flask from authlib.integrations.flask_client import OAuth # NOTE: For actual use, configure these securely from environment variables # or a configuration management system, not hardcoded. CLIENT_ID = os.environ.get('GOOGLE_CLIENT_ID', 'your-google-client-id') CLIENT_SECRET = os.environ.get('GOOGLE_CLIENT_SECRET', 'your-google-client-secret') app = Flask(__name__) app.config.update({ 'SECRET_KEY': 'very-secret-key-for-session', 'GOOGLE_CLIENT_ID': CLIENT_ID, 'GOOGLE_CLIENT_SECRET': CLIENT_SECRET }) oauth = OAuth(app) oauth.register( name='google', client_id=app.config['GOOGLE_CLIENT_ID'], client_secret=app.config['GOOGLE_CLIENT_SECRET'], access_token_url='https://oauth2.googleapis.com/token', authorize_url='https://accounts.google.com/o/oauth2/auth', api_base_url='https://www.googleapis.com/oauth2/v1/', client_kwargs={'scope': 'openid email profile'} ) print("Authlib OAuth client registered for Google. ") print("This example demonstrates type-checked setup, but does not run a server.") print("Run a type checker like MyPy on this file after installing types-authlib.")
Debug
Known issues
gotchaThe `types-authlib` package provides only type stubs and does not install `Authlib` itself. For effective type checking and runtime functionality, you must install both `Authlib` (e.g., `pip install Authlib`) and `types-authlib`.
fix
Ensure both `Authlib` and `types-authlib` are present in your project's dependencies.
affects: All versions
breakingThe `types-authlib` package is specifically versioned to target a particular `Authlib` runtime library release (e.g., `types-Authlib==1.6.9.x` provides stubs for `Authlib==1.6.9`). Mismatches between the installed `types-authlib` version and the `Authlib` version can lead to type checking errors or unannotated code.
fix
Align the major and minor version of `types-authlib` with your `Authlib` installation (e.g., `pip install 'Authlib==1.6.*' 'types-Authlib==1.6.*'`).
affects: All versions
gotchaAs `types-authlib` is part of the `typeshed` project, its stubs are automatically released and updated frequently. These updates can sometimes introduce minor changes that might cause new type checker warnings or errors, even if the underlying `Authlib` library has not changed. [8]
fix
Consider pinning the version of `types-authlib` in your `requirements.txt` or `pyproject.toml` to ensure consistent type checking results across environments.
affects: All versions
breaking`types-authlib` requires Python `>=3.10`. Using it with older Python versions will result in installation failures or compatibility issues. Note that `Authlib` itself dropped Python 2 support with version 1.0.0.
fix
Ensure your project is running on Python 3.10 or newer.
affects: <3.10
breakingAuthlib itself has undergone significant API changes in major versions (e.g., 0.12, 0.14, 1.0, 1.1) related to grant systems, removal of built-in SQLAlchemy integration, and JOSE module renames. If you upgrade Authlib, ensure you also update `types-authlib` to a compatible version to avoid numerous type checking errors. [1, 2, 4, 5]
fix
Refer to the Authlib changelog for breaking changes (e.g., `docs.authlib.org/en/latest/history.html`) and update both `Authlib` and `types-Authlib` accordingly.
affects: Authlib < 1.0
Upgrade
Version history
1.7.2.20260827latest on PyPI · released Aug 27, 2026
Audit
Dependencies
AuthlibrequiredProvides the runtime functionality that these stubs type-check. You must install Authlib separately.
Agent activity
36 hits · last 30 days
node
30
OpenAI (training)
1
Resources
types-authlib — pip install types-authlib · libregistry