{"id":3625,"library":"mypy-boto3-marketplace-catalog","title":"mypy-boto3-marketplace-catalog Type Annotations","description":"mypy-boto3-marketplace-catalog provides type annotations for the `boto3` AWS Marketplace Catalog service, ensuring type-safe interactions with the AWS API. It is part of the `mypy-boto3` project, which frequently releases updates to keep pace with `boto3` and `botocore` changes, generated using `mypy-boto3-builder 8.12.0`.","status":"active","version":"1.42.41","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type checking","mypy","boto3","aws","amazon marketplace catalog","stubs"],"install":[{"cmd":"pip install mypy-boto3-marketplace-catalog","lang":"bash","label":"Install specific service stubs"},{"cmd":"pip install 'boto3-stubs[marketplace-catalog]'","lang":"bash","label":"Install via boto3-stubs meta-package"}],"dependencies":[{"reason":"Provides the runtime functionality for which these are type stubs.","package":"boto3"}],"imports":[{"note":"Used for type-hinting the client returned by `boto3.client('marketplace-catalog')`.","symbol":"MarketplaceCatalogClient","correct":"from mypy_boto3_marketplace_catalog.client import MarketplaceCatalogClient"},{"note":"Used for type-hinting the complex dictionary responses from API calls.","symbol":"ListEntitiesResponseTypeDef","correct":"from mypy_boto3_marketplace_catalog.type_defs import ListEntitiesResponseTypeDef"}],"quickstart":{"code":"import os\nfrom typing import TYPE_CHECKING\nimport boto3\n\nif TYPE_CHECKING:\n    from mypy_boto3_marketplace_catalog.client import MarketplaceCatalogClient\n    from mypy_boto3_marketplace_catalog.type_defs import ListEntitiesResponseTypeDef\n\n# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, etc.\n# For local testing, ensure dummy credentials or a valid AWS config exist.\n# os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY')\n# os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET')\n# os.environ['AWS_SESSION_TOKEN'] = os.environ.get('AWS_SESSION_TOKEN', 'DUMMY_TOKEN')\n# os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')\n\ndef list_marketplace_entities() -> list[str]:\n    client: 'MarketplaceCatalogClient' = boto3.client('marketplace-catalog')\n    try:\n        response: 'ListEntitiesResponseTypeDef' = client.list_entities(\n            Catalog='AWSMarketplace', EntityType='ContainerProduct'\n        )\n        entity_ids = [entity['EntityId'] for entity in response.get('EntitySummaryList', [])]\n        print(f\"Found {len(entity_ids)} Marketplace Catalog entities.\")\n        return entity_ids\n    except Exception as e:\n        print(f\"Error listing entities: {e}\")\n        return []\n\nif __name__ == '__main__':\n    entities = list_marketplace_entities()\n    if entities:\n        print(f\"First 3 entity IDs: {entities[:3]}\")\n","lang":"python","description":"This example demonstrates how to use `mypy-boto3-marketplace-catalog` to type-hint a `boto3` Marketplace Catalog client and its responses. It lists entities of type 'ContainerProduct' from the 'AWSMarketplace' catalog. The `if TYPE_CHECKING:` block ensures that the type stub imports are only processed by type checkers and not during runtime, preventing unnecessary runtime dependencies."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed for all `mypy-boto3` packages starting with `mypy-boto3-builder 8.12.0`. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (corresponds to mypy-boto3-marketplace-catalog >=1.42.41)"},{"fix":"If you explicitly import `TypeDef` objects, you may need to adjust their names in your code to match the new patterns. Refer to the `mypy-boto3-builder` release notes for details.","message":"Breaking changes to `TypeDef` naming conventions were introduced in `mypy-boto3-builder 8.9.0`. Type definitions for packed method arguments may use shorter names, and conflicting `Extra` postfixes are now moved to the end.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder"},{"fix":"Always try to match the `mypy-boto3` stub version as closely as possible to your `boto3` runtime version. The `mypy-boto3` project aims to align its versions with `boto3`.","message":"Type stubs are generated for specific `boto3` versions. A mismatch between the installed `mypy-boto3-marketplace-catalog` version and your runtime `boto3` version can lead to incorrect or missing type hints.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Example: `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_marketplace_catalog.client import MarketplaceCatalogClient`. This ensures type imports are ignored at runtime.","message":"To avoid introducing runtime dependencies on `mypy-boto3` packages, always wrap type stub imports within an `if TYPE_CHECKING:` block.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Most modern type checkers (like MyPy, Pyright) should automatically handle PEP 561 packages. Verify your type checker configuration is recent.","message":"The `mypy-boto3` project migrated to PEP 561 compliant packages. While generally beneficial for type checkers, ensure your type checking setup is up-to-date.","severity":"gotcha","affected_versions":">=8.12.0 of mypy-boto3-builder (corresponds to mypy-boto3-marketplace-catalog >=1.42.41)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}