Registry / type-stubs / mypy-boto3-cognito-identity

mypy-boto3-cognito-identity

JSON →
library1.43.0pypypi✓ verified 23d ago

This library provides PEP 561 compliant type annotations (stubs) for the `boto3` client for AWS CognitoIdentity service. It enhances type checking for `boto3` calls, improving code reliability and developer experience. Maintained by the `mypy-boto3-builder` project, it releases frequently, often in sync with new `boto3` service definitions or `mypy-boto3-builder` updates.

pip install mypy-boto3-cognito-identity
INSTALL
IMPORT
SIG · MYPY-BOTO3-COGNITO
M
mypy-boto3-cognito-identity
type-stubspythonv1.43.0
Install
1.7s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

CognitoIdentityClient
from mypy_boto3_cognito_identity import CognitoIdentityClient
from mypy_boto3_cognito_identity import CognitoIdentityClient

This example demonstrates how to initialize a `boto3` CognitoIdentity client with type hinting from `mypy-boto3-cognito-identity` and perform a basic operation (`get_id`). Ensure `boto3` is also installed. Type checking will catch incorrect arguments or attribute access on the `response` object.

import boto3 import os from mypy_boto3_cognito_identity.client import CognitoIdentityClient from mypy_boto3_cognito_identity.type_defs import GetIdResponseTypeDef # Instantiate a boto3 client for CognitoIdentity, type-hinted by the stubs # In a real application, credentials would be managed via IAM roles or environment variables. client: CognitoIdentityClient = boto3.client( "cognito-identity", region_name="us-east-1", # Replace with your AWS region aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''), aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '') ) # Example: Get an identity ID (replace with actual AccountId and IdentityPoolId) # Note: This operation creates an identity if it doesn't exist for the given pool. try: response: GetIdResponseTypeDef = client.get_id( AccountId="123456789012", # Replace with a valid AWS Account ID IdentityPoolId="us-east-1:abcdefgh-abcd-abcd-abcd-abcdefghijkl" # Replace with a valid Identity Pool ID ) identity_id = response.get('IdentityId') print(f"Successfully retrieved Identity ID: {identity_id}") except Exception as e: print(f"An error occurred: {e}") # Mypy will now correctly validate argument types and response structure.
Debug
Known issues
breakingPython 3.8 is no longer supported. Packages built with `mypy-boto3-builder` 8.12.0+ (including this version) require Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or newer.
affects: 1.42.3+
breakingMigration to PEP 561 packaging (namespace packages). While generally transparent, this change might require updating your `mypy` version or refreshing your virtual environment if you encounter issues with stub discovery.
fix
Ensure `mypy` is up-to-date. Recreate your virtual environment if stub paths seem incorrect or `mypy` fails to find types.
affects: 1.42.3+
gotchaThis package provides *only* type stubs. You must separately install the `boto3` library for actual runtime functionality. `mypy-boto3-cognito-identity` does not replace `boto3`.
fix
Ensure both `pip install boto3` and `pip install mypy-boto3-cognito-identity` are executed.
affects: All versions
breakingTypeDef naming conventions changed for packed method arguments, potentially breaking existing type hints if custom TypeDefs were manually defined or referenced. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`.
fix
Review and update any custom `TypeDef` references or aliases in your codebase to match the new shorter names.
affects: Versions generated by `mypy-boto3-builder` 8.9.0 and newer (e.g., this package version 1.42.3).
gotchaService support within the `mypy-boto3` ecosystem can change. Services might be deprecated, renamed (e.g., `sms-voice` to `pinpoint-sms-voice`), or excluded from builds, potentially breaking imports for other `mypy-boto3-*` packages.
fix
Check `mypy-boto3-builder` release notes for changes affecting specific services. Update package names or imports as required.
affects: All versions (ecosystem-wide)
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThese are type stubs for boto3; boto3 must be installed for runtime functionality.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
mypy-boto3-cognito-identity — pip install mypy-boto3-cognito-identity · libregistry