Registry / type-stubs / types-boto3-secretsmanager

types-boto3-secretsmanager

JSON →
library1.43.0pypypiunverified

types-boto3-secretsmanager provides comprehensive type annotations for the `boto3` AWS Secrets Manager service, enhancing static analysis, code completion, and overall developer experience in Python projects. It is automatically generated by the `mypy-boto3-builder` and is currently at version 1.42.8, with releases closely tracking `boto3` updates to ensure compatibility and extensive type coverage across all service operations, paginators, and type definitions.

pip install types-boto3-secretsmanager
INSTALL
IMPORT
SIG · TYPES-BOTO3-SECRET
T
types-boto3-secretsmanager
type-stubspythonv1.43.0
Install
3.3s avg
Import
Disk
67MB
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.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 69MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 3.3s · import 0.000s · 19MB
67MB installed
● package 67MB
Code
Verified usage

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

SecretsManagerClient
from types_boto3_secretsmanager import SecretsManagerClient
from mypy_boto3_secretsmanager import SecretsManagerClient

This quickstart demonstrates how to initialize a `boto3` Secrets Manager client and retrieve a secret value with the benefit of static type checking provided by `types-boto3-secretsmanager`. The `if TYPE_CHECKING:` block ensures that `mypy_boto3_secretsmanager` is only used for type analysis and not as a runtime dependency.

import boto3 from typing import TYPE_CHECKING import os # Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials) # os.environ['AWS_ACCESS_KEY_ID'] = 'YOUR_ACCESS_KEY' # os.environ['AWS_SECRET_ACCESS_KEY'] = 'YOUR_SECRET_KEY' # os.environ['AWS_REGION'] = 'us-east-1' if TYPE_CHECKING: from mypy_boto3_secretsmanager import SecretsManagerClient def get_secret_value_typed(secret_name: str, region_name: str) -> str: session = boto3.session.Session() client: SecretsManagerClient = session.client( service_name='secretsmanager', region_name=region_name, ) try: response = client.get_secret_value( SecretId=secret_name ) if 'SecretString' in response: return response['SecretString'] elif 'SecretBinary' in response: return response['SecretBinary'].decode('utf-8') # Assuming UTF-8 encoded binary except client.exceptions.ResourceNotFoundException: print(f"Secret '{secret_name}' not found.") except client.exceptions.ClientError as e: print(f"An AWS client error occurred: {e}") return "" # Example usage (uncomment and replace with valid secret name and region) # if __name__ == "__main__": # secret = get_secret_value_typed("my-test-secret", os.environ.get('AWS_REGION', 'us-east-1')) # if secret: # print(f"Retrieved secret: {secret}")
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generated this package), Python 3.8 is no longer supported for generated stub packages. This applies to `types-boto3-secretsmanager` versions built with builder 8.12.0 or newer.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (and corresponding types-boto3-secretsmanager versions)
breakingFollowing the migration to PEP 561 packages in `mypy-boto3-builder` 8.12.0, ensure your `mypy` or other type checker is up-to-date. Older versions might not correctly discover or utilize the stubs, leading to `Missing type stub` errors or incorrect type inference.
fix
Update your type checker (e.g., `pip install --upgrade mypy`) and ensure it's configured to recognize PEP 561-compliant stub packages.
affects: mypy-boto3-builder >= 8.12.0 (and corresponding types-boto3-secretsmanager versions)
breakingIn `mypy-boto3-builder` version 8.9.0, type definition (TypeDef) naming conventions changed. This includes shorter names for packed method arguments and revised postfix handling for conflicting `TypeDef` names (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).
fix
Update your code to use the new `TypeDef` names as per the latest stub documentation. Your IDE or type checker should highlight these if you are using explicit type hints.
affects: mypy-boto3-builder >= 8.9.0 (and corresponding types-boto3-secretsmanager versions)
gotchaThese packages provide only type stubs and are not intended for runtime use. To avoid adding `types-boto3-secretsmanager` as a production dependency and ensure it's only used by static analysis tools, wrap your type imports within an `if TYPE_CHECKING:` block.
fix
Use `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_secretsmanager import SecretsManagerClient` (and similar for other types), with fallback assignments to `object` in the `else` block if `pylint` complains.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides runtime functionality for which these are type stubs.
pythonrequiredMinimum Python version required for generated stubs.
Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
2
Resources
types-boto3-secretsmanager — pip install types-boto3-secretsmanager · libregistry