mypy-boto3-marketplace-deployment Type Stubs
mypy-boto3-marketplace-deployment provides machine-generated type annotations (type stubs) for the `boto3` AWS SDK's MarketplaceDeploymentService. These stubs enhance static analysis, autocompletion, and error checking in IDEs and type checkers like MyPy, ensuring more robust and maintainable AWS automation scripts. The library is currently at version 1.42.3, mirroring the `boto3` version it types, and is actively maintained with updates generated by `mypy-boto3-builder`.
Warnings
- breaking As of `mypy-boto3-builder` version 8.12.0, Python 3.8 support has been removed. All `mypy-boto3` packages, including this one, now require Python >=3.9.
- breaking The `mypy-boto3-builder` (version 8.9.0) introduced changes to how TypeDef names are generated, potentially shortening them (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`) or adjusting postfixes for conflicting names. While specific to the builder, this impacts all generated service stubs if such naming conflicts existed.
- gotcha This package provides type stubs *only* for the `MarketplaceDeploymentService`. For comprehensive `boto3` type annotations covering all services, you should install the `boto3-stubs` metapackage (e.g., `pip install boto3-stubs[full]`) or specific service stubs for each service you use (e.g., `pip install boto3-stubs[s3,ec2]`). Installing only this package will not provide types for other boto3 services.
- gotcha It is highly recommended to wrap `mypy-boto3` type imports within `if TYPE_CHECKING:` blocks. This prevents the stub packages from becoming runtime dependencies, keeping your production environment lighter and cleaner. Tools like Pylint might complain about undefined variables without this pattern or by assigning `object` in the `else` branch.
Install
-
pip install mypy-boto3-marketplace-deployment -
pip install boto3-stubs[marketplace-deployment]
Imports
- MarketplaceDeploymentServiceClient
from mypy_boto3_marketplace_deployment import MarketplaceDeploymentServiceClient
- DeploymentParameterInputTypeDef
from mypy_boto3_marketplace_deployment.type_defs import DeploymentParameterInputTypeDef
- MarketplaceDeploymentServiceServiceName
from mypy_boto3_marketplace_deployment.literals import MarketplaceDeploymentServiceServiceName
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_marketplace_deployment import MarketplaceDeploymentServiceClient
from mypy_boto3_marketplace_deployment.type_defs import DeploymentParameterInputTypeDef
def get_marketplace_deployment_client() -> 'MarketplaceDeploymentServiceClient':
"""Returns a type-hinted MarketplaceDeploymentService client."""
# boto3.client is dynamically typed, mypy-boto3 provides the static types
return boto3.client("marketplace-deployment") # type: ignore[return-value]
def process_deployment_parameters(client: 'MarketplaceDeploymentServiceClient') -> None:
"""Example of using the client with typed input."""
# Example of a typed dictionary for input (replace with actual data)
deployment_param: DeploymentParameterInputTypeDef = {
"name": "ExampleParam",
"value": "ExampleValue"
}
# In a real scenario, you'd call a client method here, e.g., client.SomeOperation(**deployment_param)
print(f"Processing deployment parameter: {deployment_param['name']}")
if __name__ == "__main__":
client = get_marketplace_deployment_client()
process_deployment_parameters(client)