Registry /
type-stubs / mypy-boto3-marketplace-agreement
Install & Compatibility
Where this runs
tested against v1.43.66 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.610s · 52MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 0.600s · 53MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AgreementServiceClient
✓ from mypy_boto3_marketplace_agreement.client import AgreementServiceClient
AcceptAgreementRequestRequestTypeDef
✓ from mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementRequestRequestTypeDef
✗ from mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementRequestTypeDef
A general builder change in 8.9.0 introduced naming conventions that might alter expected TypedDict names by adding or removing 'Request' or 'Output' suffixes or other qualifiers based on context and potential conflicts. Always check the generated `type_defs.pyi` for exact names.
This quickstart demonstrates how to initialize a type-hinted `AgreementServiceClient` and use it to call an API operation, such as `accept_agreement`. It highlights the correct import paths for both the client and its associated type definitions, which are essential for leveraging static type checking with `mypy-boto3` stubs.
import boto3
from mypy_boto3_marketplace_agreement.client import AgreementServiceClient
from mypy_boto3_marketplace_agreement.type_defs import AcceptAgreementOutputTypeDef, AcceptAgreementRequestRequestTypeDef
import os
def get_agreement_client() -> AgreementServiceClient:
"""Returns a type-hinted boto3 AgreementService client."""
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# For local testing, you might mock this or ensure your environment has AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, etc.
return boto3.client("marketplace-agreement")
def accept_agreement(agreement_id: str) -> AcceptAgreementOutputTypeDef:
"""Accepts a Marketplace agreement using the type-hinted client."""
client: AgreementServiceClient = get_agreement_client()
# Example request payload, adjust as per actual API requirements
request_payload: AcceptAgreementRequestRequestTypeDef = {
"agreementId": agreement_id
}
response: AcceptAgreementOutputTypeDef = client.accept_agreement(**request_payload)
print(f"Agreement accepted: {response.get('agreementId')}")
return response
if __name__ == "__main__":
# Replace with a real agreement ID for actual testing
test_agreement_id = os.environ.get('MARKETPLACE_AGREEMENT_ID', 'ag-xxxxxxxxxxxxxxxxx')
if test_agreement_id == 'ag-xxxxxxxxxxxxxxxxx':
print("Please set the MARKETPLACE_AGREEMENT_ID environment variable for a real test.")
print("Using a placeholder ID.")
try:
# This call will require valid AWS credentials and a real agreement ID to succeed.
# If credentials are not configured or ID is invalid, it will raise a boto3 exception.
accept_agreement(test_agreement_id)
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure 'boto3' is installed and AWS credentials are configured correctly.")
Debug
Known issues
breakingSupport for Python 3.8 has been removed across all `mypy-boto3` packages. Projects targeting `mypy-boto3` builder versions 8.12.0 and above must use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or higher.
affects: >=8.12.0 (builder version), affects all generated stub packages
breakingType definition names (`TypeDef`s) generated by `mypy-boto3-builder` might have changed for some services to use shorter names or resolve conflicts. For instance, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`. This could affect code directly importing or referencing these generated type names.fixReview your explicit `TypeDef` imports and usage. Refer to the `type_defs.pyi` file within the specific `mypy-boto3-` service package for the correct, updated type names.
affects: >=8.9.0 (builder version), affects all generated stub packages
gotchaThe `mypy-boto3-marketplace-agreement` package provides *only* type stubs. You must explicitly install `boto3` (or `aioboto3` for async clients) to have the actual AWS SDK functionality at runtime. The stub package does not pull `boto3` as a runtime dependency.fixAlways install `boto3` alongside `mypy-boto3-marketplace-agreement`: `pip install boto3 mypy-boto3-marketplace-agreement`.
affects: All versions
gotchaAs of `mypy-boto3-builder` 8.12.0, all packages have migrated to PEP 561, becoming `py.typed` packages. While this is a standard and generally beneficial change, older `mypy` configurations or tools that rely on specific `MYPYPATH` setups might need adjustments to correctly locate the stubs.fixEnsure your `mypy` configuration is up-to-date and correctly identifies installed `py.typed` packages. In most cases, `mypy` will find them automatically, but complex setups might require verifying `MYPYPATH` or other stub path configurations.
affects: >=8.12.0 (builder version), affects all generated stub packages
Upgrade
Version history
1.43.66latest on PyPI · released Aug 7, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself must be installed to use the AWS SDK functionality.
mypyoptionalmypy is the primary static type checker that leverages these stubs.