{"id":3663,"library":"mypy-boto3-partnercentral-selling","title":"mypy-boto3-partnercentral-selling Type Annotations","description":"mypy-boto3-partnercentral-selling provides type annotations for the `boto3` PartnerCentralSellingAPI service. It enables static type checking for `boto3` client calls, methods, and responses, enhancing code reliability and developer experience. The current version is 1.42.80, and it is frequently updated to align with `boto3` and AWS API changes.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","type-hints","stubs","partnercentral","sellingapi"],"install":[{"cmd":"pip install boto3 mypy-boto3-partnercentral-selling","lang":"bash","label":"Install `boto3` and type stubs"}],"dependencies":[{"reason":"Provides the underlying AWS SDK runtime functionality. The stubs annotate this library.","package":"boto3","optional":false},{"reason":"Required for some advanced type features on Python versions older than 3.9, though less critical since 8.12.0+ requires Python 3.9+.","package":"typing-extensions","optional":true}],"imports":[{"note":"This is the primary way to import the type for the PartnerCentralSellingAPI boto3 client.","symbol":"PartnerCentralSellingAPIClient","correct":"from mypy_boto3_partnercentral_selling.client import PartnerCentralSellingAPIClient"},{"note":"If using service resources (less common for this specific service), this provides its type.","symbol":"ServiceResource","correct":"from mypy_boto3_partnercentral_selling.service_resource import PartnerCentralSellingAPIResource"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_partnercentral_selling.client import PartnerCentralSellingAPIClient\nfrom typing import TYPE_CHECKING\n\n# Recommended: Use TYPE_CHECKING for imports only used by type checkers\nif TYPE_CHECKING:\n    # Only import if you need specific TypeDefs for complex scenarios\n    from mypy_boto3_partnercentral_selling.type_defs import GetPartnerAccountOutputTypeDef\n\ndef get_partnercentral_selling_client() -> PartnerCentralSellingAPIClient:\n    # boto3.client returns the actual client, which is type-checked by mypy-boto3-*\n    return boto3.client(\"partnercentral-selling\")\n\nclient: PartnerCentralSellingAPIClient = get_partnercentral_selling_client()\n\ntry:\n    # Example API call with type-hinted client\n    # Replace 'YOUR_PARTNER_ACCOUNT_ID' with a real one for a runnable example\n    response = client.get_partner_account(partnerAccountId=os.environ.get('PARTNER_ACCOUNT_ID', 'YOUR_PARTNER_ACCOUNT_ID'))\n\n    print(f\"Partner account name: {response.get('partnerAccountName')}\")\n    print(f\"Account status: {response.get('accountStatus')}\")\n\nexcept client.exceptions.ResourceNotFoundException:\n    print(\"Partner account not found.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `boto3` client for PartnerCentralSellingAPI and use it. The `mypy-boto3-partnercentral-selling` package provides the necessary type stubs, allowing tools like MyPy to validate your AWS API calls and responses statically."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher to continue receiving updates and full type-checking support. If stuck on Python 3.8, pin `mypy-boto3-builder` and related packages to versions <= 8.11.x.","message":"As of `mypy-boto3-builder` version 8.12.0, support for Python 3.8 has been removed across all `mypy-boto3` packages, including `mypy-boto3-partnercentral-selling`.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Ensure both `boto3` and the specific `mypy-boto3-<service>` stub package are installed via `pip install boto3 mypy-boto3-partnercentral-selling`.","message":"The `mypy-boto3-*` packages provide *only* type annotations. You must have the `boto3` library itself installed for runtime functionality. They are not a replacement for `boto3`.","severity":"gotcha","affected_versions":"all"},{"fix":"Periodically update both `boto3` and all `mypy-boto3-*` packages together (e.g., `pip install --upgrade boto3 mypy-boto3-partnercentral-selling`). Consider using a dependency management tool to pin versions.","message":"It is crucial to keep your `mypy-boto3-*` stub packages in sync with your `boto3` library version. Mismatched versions can lead to incorrect type hints or `mypy` errors if API definitions have changed.","severity":"gotcha","affected_versions":"all"},{"fix":"If you explicitly import and use specific `TypeDef` classes from `mypy_boto3_partnercentral_selling.type_defs`, verify their names after upgrading `mypy-boto3`.","message":"Starting with `mypy-boto3-builder` 8.9.0, some generated `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) or had conflicting postfixes moved (`CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). While `partnercentral-selling` might not be directly affected by these *specific* examples, be aware that explicit imports of `TypeDef` objects might require updates.","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Ensure your `mypy` configuration correctly finds type stubs for installed packages. Standard `mypy` setup should work automatically, but if you encounter 'module not found' errors for types, check `mypy`'s `MYPYPATH` or `[tool.mypy]` configuration.","message":"As of `mypy-boto3-builder` 8.12.0, all packages migrated to PEP 561-compliant distribution. This means the type information is now directly within the installed package structure. While generally beneficial, older type checkers or unusual import configurations might need adjustment.","severity":"gotcha","affected_versions":">=8.12.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}