skillfed

pycognito

Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support.

pycognito v2024.5.1 2.5M downloads/30d#3,050 on PyPI149
Permissive license Apache License 2.0 Active released

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 pycognito

uv

uv add pycognito

poetry

poetry add pycognito

Installing 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

Environment :: Web EnvironmentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

aws cognito authentication pythoncognito user pool logincognito srp authenticationaws identity management pythoncognito token verificationcognito user managementpython cognito wrapper
aws-cognitoauthenticationidentity-management

More Python Modules packages