pycognito
Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support.
What it is and what it does
pyCognito wraps AWS Cognito's authentication and user management capabilities behind a simpler Python interface. It handles user registration, login (including SRP-based authentication), password resets, token verification, and administrative operations like listing users and groups. The package manages JWT token claims, supports multi-factor authentication flows, and can work with device authentication if your Cognito pool is configured for it.
The package depends on boto3 for AWS API calls, pyjwt for token verification, requests for HTTP operations, and envs for environment variable handling. It supports Python 3.8 through 3.12 and is designed for applications that need to integrate Cognito without writing low-level Boto3 boilerplate.
Use it for:
- Build a web application login flow that delegates authentication to AWS Cognito without managing tokens directly.
- Implement user self-service registration and password reset workflows in a serverless backend.
- Verify Cognito ID and access tokens in API middleware or Lambda authorizers.
- Manage user attributes and group memberships programmatically from a Python admin panel.
- Authenticate requests using SRP to avoid sending plaintext passwords over the wire.
- Handle multi-factor authentication challenges in a custom authentication UI.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Simplifies AWS Cognito user authentication and management for Python applications by wrapping Boto3's Cognito client with methods for registration, login, password reset, token verification, and user/group operations.
Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a real friction point for Python developers integrating Cognito. No known vulnerabilities. Install it if your application uses AWS Cognito and you want to avoid writing Boto3 boilerplate for common auth flows.
Install
pycognito on PyPI
pip
pip install pycognitouv
uv add pycognitopoetry
poetry add pycognitoInstalling pycognito
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of March 2026 with recent releases; the repository shows 149 stars and no archival.
License in practice
Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install pycognito
from pycognito import Cognito
u = Cognito('your-user-pool-id', 'your-client-id', username='bob')
u.authenticate(password='bobs-password')
print(u.id_token, u.access_token)
Requires valid AWS Cognito user pool ID and client ID; AWS credentials (via boto3) must be configured in your environment or passed explicitly.
Verify before relying
- Whether SRP (Secure Remote Password) authentication is enabled by default or requires explicit configuration.
- Support for device authentication flows and whether DeviceKey/DeviceGroupKey handling is automatic or manual.
- Whether MFA challenges (SMS and software token) are fully handled or require application-level orchestration.
- Performance characteristics when managing large user pools or batch operations.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — boto3, envs, pyjwt, requests |
| Maintenance | actively maintained — 820 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,469,152/month — #3,050 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycognito-2024.5.1-py3-none-any.whl
Keywords: aws, cognito, api, gateway, serverless
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
Flask-AWSCognitoIntegrates AWS Cognito user authentication into…
permissive · top 15,000 on PyPI
warrantWarrant wraps AWS Cognito user management…
permissive · top 15,000 on PyPI
aws-cdk.aws-cognitoProvides AWS CDK constructs for defining Amazon…
permissive · top 15,000 on PyPI
Flask-CognitoFlask-Cognito integrates AWS Cognito JWT…
permissive · top 15,000 on PyPI
cognitojwtDecodes and verifies Amazon Cognito JWT tokens…
permissive · top 15,000 on PyPI
fastapi-cognitoDecodes, validates, and parses AWS Cognito JWT…
permissive · top 15,000 on PyPI
fastapi-cloudauthIntegrates FastAPI applications with cloud…
permissive · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
django-allauthProvides integrated local and social…
permissive · top 5,000 on PyPI
h2o-authnProvides OAuth 2.0 token management for H2O…
permissive · top 15,000 on PyPI