Registry /
type-stubs / types-aiobotocore-cognito-idp
Install & Compatibility
Where this runs
tested against v3.7.0 · 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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CognitoIdentityProviderClient
✓ from types_aiobotocore_cognito_idp import CognitoIdentityProviderClient
✗ from types_aiobotocore_cognito_idp import CognitoIdentityProviderClient
This quickstart demonstrates how to use `aiobotocore` with `types-aiobotocore-cognito-idp` for type-safe interaction with AWS Cognito Identity Provider. It creates a client, then calls `list_users` to retrieve user information, leveraging the provided type hints for client methods and response structures. Remember to configure your AWS credentials and a Cognito User Pool ID.
import asyncio
import os
import aiobotocore
from types_aiobotocore_cognito_idp.client import CognitoIdentityProviderClient
from types_aiobotocore_cognito_idp.type_defs import ListUsersResponseTypeDef
async def main():
# Ensure AWS credentials are set up (e.g., via environment variables, ~/.aws/credentials)
# This example assumes you have valid credentials for Cognito User Pools.
# Using aiobotocore.get_session() is the recommended way for aiobotocore
session = aiobotocore.get_session()
async with session.create_client(
"cognito-idp",
region_name=os.environ.get("AWS_REGION", "us-east-1"),
aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID", ""), # Provide actual credentials or rely on env/config
aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY", ""), # Provide actual credentials or rely on env/config
) as client:
# The client object will be correctly typed as CognitoIdentityProviderClient
# by type checkers like MyPy due to the installed stubs.
typed_client: CognitoIdentityProviderClient = client
user_pool_id = os.environ.get("COGNITO_USER_POOL_ID", "") # Replace with your User Pool ID
if not user_pool_id:
print("Error: COGNITO_USER_POOL_ID environment variable not set.")
return
try:
response: ListUsersResponseTypeDef = await typed_client.list_users(
UserPoolId=user_pool_id,
Limit=2
)
print(f"Successfully listed users in User Pool '{user_pool_id}':")
for user in response.get("Users", []):
print(f" - Username: {user.get('Username')}, Status: {user.get('UserStatus')}")
if "PaginationToken" in response:
print(f" (Next token: {response['PaginationToken']})")
except Exception as e:
print(f"Error listing users: {e}")
print("Ensure COGNITO_USER_POOL_ID and AWS credentials are correctly set and have permissions.")
if __name__ == "__main__":
# To run this example, set environment variables:
# export AWS_REGION="your-aws-region"
# export AWS_ACCESS_KEY_ID="your-access-key"
# export AWS_SECRET_ACCESS_KEY="your-secret-key"
# export COGNITO_USER_POOL_ID="your-cognito-user-pool-id"
asyncio.run(main())
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generated `types-aiobotocore-cognito-idp` 3.4.0), Python 3.8 is no longer supported for any generated packages.fixUpgrade your Python environment to 3.9 or higher. The minimum required Python version is now 3.9.
affects: >=3.4.0 (for this package), >=8.12.0 (for builder)
gotchaThis package provides *only* type annotations (stubs) for `aiobotocore`. It does not contain any runtime code for interacting with AWS. You must install `aiobotocore` separately for your application to function.fixEnsure you have `aiobotocore` installed in your project: `pip install aiobotocore`.
affects: All versions
Upgrade
Version history
3.7.0latest on PyPI · released May 10, 2026
Audit
Dependencies
aiobotocorerequiredRuntime dependency for the actual AWS API calls. This package only provides type stubs.