{"id":6278,"library":"types-aiobotocore-secretsmanager","title":"Type Annotations for aiobotocore Secrets Manager","description":"This library provides a complete set of PEP 561 type annotations for `aiobotocore`'s Secrets Manager service. It enhances development with static type checking, autocompletion, and refactoring support for asynchronous AWS operations. Currently at version 3.4.0, it is part of the `mypy-boto3-builder` ecosystem which follows a frequent release cadence, often aligning with new `aiobotocore` and AWS service updates.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","aiobotocore","secretsmanager","typing","mypy","type-annotations","async"],"install":[{"cmd":"pip install types-aiobotocore-secretsmanager","lang":"bash","label":"Install service-specific type stubs"}],"dependencies":[{"reason":"Runtime library for asynchronous AWS interactions.","package":"aiobotocore","optional":false},{"reason":"Core type stubs for aiobotocore, required by service-specific stubs.","package":"types-aiobotocore","optional":false}],"imports":[{"note":"Import the client type for static analysis.","symbol":"SecretsManagerClient","correct":"from types_aiobotocore_secretsmanager.client import SecretsManagerClient"},{"note":"The canonical way to get the session object is via 'aiobotocore.session.get_session()' or importing 'aiobotocore.session' directly.","wrong":"from aiobotocore.session import AioSession","symbol":"AioSession","correct":"import aiobotocore.session"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport asyncio\nimport aiobotocore.session\n\n# These types are only needed for type checking, not at runtime\nif TYPE_CHECKING:\n    from types_aiobotocore_secretsmanager.client import SecretsManagerClient\n\nasync def get_secrets_manager_client():\n    session = aiobotocore.session.get_session()\n    # Annotate the client with the imported type for full type-checking benefits\n    client: SecretsManagerClient\n    async with session.client(\"secretsmanager\") as client:\n        try:\n            response = await client.list_secrets()\n            print(f\"Secrets: {[s['Name'] for s in response.get('SecretList', [])]}\")\n        except Exception as e:\n            print(f\"Error listing secrets: {e}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(get_secrets_manager_client())\n","lang":"python","description":"This quickstart demonstrates how to obtain a typed `SecretsManagerClient` using `aiobotocore.session` and perform a basic asynchronous operation like listing secrets. The `TYPE_CHECKING` block ensures type imports do not add runtime dependencies."},"warnings":[{"fix":"Ensure your project uses Python 3.9 or newer. If you must use Python 3.8, pin to an older `types-aiobotocore-secretsmanager` version (e.g., `<3.4.0`) that was built with `mypy-boto3-builder` <8.12.0.","message":"Python 3.8 support has been dropped starting with `mypy-boto3-builder` version 8.12.0. This means `types-aiobotocore-secretsmanager` versions built with 8.12.0 or later (including 3.4.0) require Python 3.9 or higher.","severity":"breaking","affected_versions":">=3.4.0"},{"fix":"Always install `types-aiobotocore-secretsmanager` with a version constraint that matches your `aiobotocore` installation, or allow `pip` to resolve compatible versions. For example, if you have `aiobotocore==2.13.0`, you should ideally install `types-aiobotocore-secretsmanager==2.13.0` (or `~=2.13.0`). The `types-aiobotocore-secretsmanager` package has `aiobotocore` as a runtime dependency, so pip *should* find a compatible version.","message":"It is crucial to align the version of `types-aiobotocore-secretsmanager` with the version of `aiobotocore` (and potentially `types-aiobotocore`) you are using at runtime. Mismatched versions can lead to incorrect types or missing attributes/methods, causing static analysis errors or runtime issues that type checking might miss.","severity":"gotcha","affected_versions":"*"},{"fix":"If you are directly importing and using specific `TypeDef` classes and upgrading to a new major version of `types-aiobotocore-secretsmanager`, review the release notes of `mypy-boto3-builder` for potential naming changes to `TypeDef` structures. Update your imports accordingly.","message":"The `mypy-boto3-builder` (which generates this package) introduced breaking changes in `8.9.0` regarding TypeDef naming conventions, such as `CreateDistributionRequestRequestTypeDef` becoming `CreateDistributionRequestTypeDef`. While this specific example is not for Secrets Manager, similar changes may occur in future versions for other service TypeDefs, if names become too long or conflicting.","severity":"breaking","affected_versions":">=3.0.0 (as built with builder >=8.9.0)"},{"fix":"Ensure `aiobotocore` is installed in your environment: `pip install aiobotocore`.","message":"This package is a type stub package (`py.typed`) and provides only type annotations. It does not include the actual runtime implementation of the `aiobotocore` Secrets Manager client. You must install `aiobotocore` separately for the code to run.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}