{"id":3058,"library":"mypy-boto3-cognito-identity","title":"mypy-boto3-cognito-identity Type Stubs","description":"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.","status":"active","version":"1.42.3","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","type-hints","stubs","cognito-identity"],"install":[{"cmd":"pip install mypy-boto3-cognito-identity","lang":"bash","label":"Install Type Stubs"}],"dependencies":[{"reason":"These are type stubs for boto3; boto3 must be installed for runtime functionality.","package":"boto3","optional":false}],"imports":[{"wrong":"from mypy_boto3_cognito_identity import CognitoIdentityClient","symbol":"CognitoIdentityClient","correct":"from mypy_boto3_cognito_identity import CognitoIdentityClient"}],"quickstart":{"code":"import boto3\nimport os\nfrom mypy_boto3_cognito_identity.client import CognitoIdentityClient\nfrom mypy_boto3_cognito_identity.type_defs import GetIdResponseTypeDef\n\n# Instantiate a boto3 client for CognitoIdentity, type-hinted by the stubs\n# In a real application, credentials would be managed via IAM roles or environment variables.\nclient: CognitoIdentityClient = boto3.client(\n    \"cognito-identity\",\n    region_name=\"us-east-1\", # Replace with your AWS region\n    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '')\n)\n\n# Example: Get an identity ID (replace with actual AccountId and IdentityPoolId)\n# Note: This operation creates an identity if it doesn't exist for the given pool.\ntry:\n    response: GetIdResponseTypeDef = client.get_id(\n        AccountId=\"123456789012\",  # Replace with a valid AWS Account ID\n        IdentityPoolId=\"us-east-1:abcdefgh-abcd-abcd-abcd-abcdefghijkl\" # Replace with a valid Identity Pool ID\n    )\n\n    identity_id = response.get('IdentityId')\n    print(f\"Successfully retrieved Identity ID: {identity_id}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n# Mypy will now correctly validate argument types and response structure.","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 is no longer supported. Packages built with `mypy-boto3-builder` 8.12.0+ (including this version) require Python 3.9 or newer.","severity":"breaking","affected_versions":"1.42.3+"},{"fix":"Ensure `mypy` is up-to-date. Recreate your virtual environment if stub paths seem incorrect or `mypy` fails to find types.","message":"Migration 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.","severity":"breaking","affected_versions":"1.42.3+"},{"fix":"Ensure both `pip install boto3` and `pip install mypy-boto3-cognito-identity` are executed.","message":"This package provides *only* type stubs. You must separately install the `boto3` library for actual runtime functionality. `mypy-boto3-cognito-identity` does not replace `boto3`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review and update any custom `TypeDef` references or aliases in your codebase to match the new shorter names.","message":"TypeDef 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`.","severity":"breaking","affected_versions":"Versions generated by `mypy-boto3-builder` 8.9.0 and newer (e.g., this package version 1.42.3)."},{"fix":"Check `mypy-boto3-builder` release notes for changes affecting specific services. Update package names or imports as required.","message":"Service 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.","severity":"gotcha","affected_versions":"All versions (ecosystem-wide)"}],"env_vars":null,"search_vec":"'561':12 'annot':15 'aw':22,64 'boto3':3,19,30,43,54,60,63 'builder':44,61 'call':31 'check':28 'client':20 'code':33 'cognito':4,71 'cognito-ident':70 'cognitoident':23 'compliant':13 'definit':56 'develop':36 'enhanc':26 'experi':37 'frequent':48 'hint':68 'ident':5,72 'improv':32 'librari':9 'maintain':38 'mypi':2,42,59,65 'mypy-boto3-builder':41,58 'mypy-boto3-cognito-identity':1 'new':53 'often':49 'pep':11 'project':45 'provid':10 'releas':47 'reliabl':34 'servic':24,55 'stub':7,16,69 'sync':51 'type':6,14,27,67 'type-hint':66 'updat':62","created_at":"2026-04-11T09:19:15.051509+00:00","updated_at":"2026-04-16T16:51:30.321230+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpy8r8t3n8/venv/lib/python3.12/site-packages/mypy_boto3_cognito_identity/__init__.py\", line 25, in <module>\n    from .client import CognitoIdentityClient\n  File \"/tmp/tmpy8r8t3n8/venv/lib/python3.12/site-packages"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_cognito_identity/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-cognito-identity/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-28","next_check":"2026-07-10","install_tag":null}}