Registry / type-stubs / mypy-boto3-ssm

mypy-boto3-ssm

JSON →
library1.43.53pypypi✓ verified 23d ago

mypy-boto3-ssm provides comprehensive type annotations for the AWS Boto3 SSM (Systems Manager) client. This library enhances static analysis, improves auto-completion in IDEs like VSCode and PyCharm, and enables early detection of potential runtime errors with type checkers like Mypy. It is currently at version 1.42.54, which aligns with a specific Boto3 version, and is generated using the `mypy-boto3-builder` (version 8.12.0). The project maintains an active release cadence, syncing with Boto3 updates.

pip install boto3 mypy-boto3-ssm
INSTALL
IMPORT
SIG · MYPY-BOTO3-SSM
M
mypy-boto3-ssm
type-stubspythonv1.43.53
Install
4.0s avg
Import
818ms
Disk
51MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.53 · 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.842s · 53MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.794s · 53MB
51MB installed
● package 51MB
Code
Verified usage

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

SSMClient
from mypy_boto3_ssm.client import SSMClient
Import the typed client for Boto3 SSM.
GetParameterResultTypeDef
from mypy_boto3_ssm.type_defs import GetParameterResultTypeDef
Import specific TypedDicts for precise type hints on API response structures.
Session().client("ssm")
client = boto3.client("ssm")
While functional, this lacks static type information. For type hints, you should annotate the client variable with `SSMClient`.

This quickstart demonstrates how to get a type-hinted AWS SSM client and retrieve a parameter. It uses explicit type annotations for the client and the response, leveraging the `mypy-boto3-ssm` stubs for static analysis and IDE support. Remember to have `boto3` installed and your AWS credentials configured.

import os import boto3 from mypy_boto3_ssm.client import SSMClient from mypy_boto3_ssm.type_defs import GetParameterResultTypeDef def get_ssm_parameter(name: str) -> str | None: # Ensure AWS credentials are available (e.g., via environment variables, ~/.aws/credentials) # For local testing, you might need to mock or ensure a valid AWS setup. # Explicitly type the client for mypy compatibility and IDE autocompletion client: SSMClient = boto3.client("ssm") try: response: GetParameterResultTypeDef = client.get_parameter(Name=name, WithDecryption=True) return response.get("Parameter", {}).get("Value") except client.exceptions.ParameterNotFound: print(f"Parameter '{name}' not found.") return None except Exception as e: print(f"An error occurred: {e}") return None # Example usage (requires an actual AWS SSM parameter and credentials) # You might need to set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION # os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', '') # os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', '') # os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1') # Example parameter name - replace with one existing in your AWS account # parameter_name = "/my/test/parameter" # parameter_value = get_ssm_parameter(parameter_name) # if parameter_value: # print(f"Value of '{parameter_name}': {parameter_value}") # else: # print(f"Could not retrieve value for '{parameter_name}'.")
Debug
Known issues
breakingSupport for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequent generated packages. Users on Python 3.8 or older must upgrade to Python 3.9+ to use the latest `mypy-boto3-ssm` versions.
fix
Upgrade your Python environment to 3.9 or higher.
affects: >=8.12.0 of builder, >=1.42.54 of stubs
breakingThe `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in builder version 8.12.0. While this primarily affects how type checkers find stubs, ensure explicit installation of service-specific stub packages (`mypy-boto3-ssm`) rather than relying on `boto3-stubs` for specific services if you encounter import issues.
fix
Explicitly install `mypy-boto3-ssm` alongside `boto3`. For broader Boto3 typing, `boto3-stubs` is an alternative, but `mypy-boto3-ssm` is for this specific service.
affects: >=8.12.0 of builder, >=1.42.54 of stubs
breakingTypeDef naming conventions changed in builder version 8.9.0, typically shortening names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While the example refers to a different service, similar renames might affect SSM-related `TypeDef` imports. Always check documentation for specific `TypeDef` names.
fix
Update your `TypeDef` import paths and names to match the new conventions, referring to the `mypy-boto3-ssm` documentation for specific services.
affects: >=8.9.0 of builder
gotcha`mypy-boto3-ssm` provides only type stubs, not the actual runtime implementation of the AWS SDK. You must install `boto3` separately for your code to execute correctly.
fix
Always include `pip install boto3` in your project's setup alongside `pip install mypy-boto3-ssm`.
affects: All versions
gotchaFor the most precise type checking of Boto3 API responses, it is recommended to explicitly import and use the generated `TypeDef` objects (e.g., `GetParameterResultTypeDef`) from `mypy_boto3_ssm.type_defs`. This provides richer type information than generic `dict` annotations.
fix
Instead of `response: dict = client.get_parameter(...)`, use `from mypy_boto3_ssm.type_defs import MyServiceResultTypeDef; response: MyServiceResultTypeDef = client.get_parameter(...)`.
affects: All versions
Upgrade
Version history
1.43.53latest on PyPI · released Jul 21, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the AWS SDK for Python. `mypy-boto3-ssm` provides only type stubs, not the actual Boto3 implementation.
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
mypy-boto3-ssm — pip install mypy-boto3-ssm · libregistry