mypy-boto3-partnercentral-account Type Stubs
This package provides type annotations for the `boto3` PartnerCentralAccountAPI service, generated by `mypy-boto3-builder`. It enables static type checking with tools like MyPy, Pyright, and enhances IDE auto-completion for `boto3` clients and resources. The `mypy-boto3` ecosystem receives frequent updates, typically aligning with new `boto3` and `botocore` releases.
Warnings
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. All generated packages, including this one, now require Python 3.9 or newer.
- breaking The `mypy-boto3-builder` migrated to PEP 561 packages in version 8.12.0. This change might affect how type checkers or IDEs locate and use the stubs if you are using older or non-standard Python tooling configurations.
- breaking TypeDef naming conventions were changed in `mypy-boto3-builder` version 8.9.0. This could lead to `NameError` if you were explicitly importing and using TypeDefs in your code.
- gotcha For PyCharm users, there can be performance issues related to `Literal` overloads in `mypy-boto3` packages. If you experience slowdowns, consider using the `boto3-stubs-lite` version which offers a more RAM-friendly experience at the cost of requiring more explicit type annotations.
Install
-
pip install mypy-boto3-partnercentral-account
Imports
- PartnerCentralAccountClient
from mypy_boto3_partnercentral_account.client import PartnerCentralAccountClient
- PartnerCentralAccountTypeDef
from mypy_boto3_partnercentral_account.type_defs import SomeTypeDef
- PartnerCentralAccountLiterals
from mypy_boto3_partnercentral_account.literals import SomeLiteral
Quickstart
import boto3
from typing import TYPE_CHECKING
import os
if TYPE_CHECKING:
from mypy_boto3_partnercentral_account.client import PartnerCentralAccountClient
# Optionally import other types like paginators, waiters, or TypeDefs
# from mypy_boto3_partnercentral_account.type_defs import CreatePartnerRequestRequestTypeDef
def get_partnercentral_account_client() -> "PartnerCentralAccountClient":
"""Returns a type-hinted PartnerCentralAccount client."""
# Ensure AWS credentials are set via environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
# or other boto3 configuration methods.
return boto3.client(
"partnercentral-account",
region_name=os.environ.get("AWS_REGION", "us-east-1")
)
client = get_partnercentral_account_client()
# Example usage: Replace with an actual API call relevant to your use case.
# get_alliance_lead_contact is used here as a simple example that doesn't require complex input.
try:
# This call might require specific permissions or existing resources in your AWS account.
response = client.get_alliance_lead_contact()
print("Successfully called get_alliance_lead_contact (example API call).")
if response:
print(f"Response keys: {list(response.keys())}")
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure AWS credentials are configured and you have permissions for partnercentral-account:GetAllianceLeadContact.")