{"id":3570,"library":"mypy-boto3-controlcatalog","title":"mypy-boto3-controlcatalog","description":"mypy-boto3-controlcatalog provides comprehensive type annotations for the AWS Control Catalog service within the `boto3` library. This allows static type checkers like MyPy and IDEs to offer accurate autocomplete, parameter suggestions, and error checking for your `boto3` client calls, improving code quality and developer productivity. It is generated by `mypy-boto3-builder` and its releases align with new `boto3` versions and `mypy-boto3-builder` updates.","status":"active","version":"1.42.55","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","cloud","controlcatalog"],"install":[{"cmd":"pip install mypy-boto3-controlcatalog","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Provides the AWS SDK runtime library that these stubs type-annotate. Users must install boto3 separately.","package":"boto3","optional":false},{"reason":"A static type checker that utilizes these stubs for type validation. Users must install mypy separately to perform type checks.","package":"mypy","optional":true},{"reason":"Minimum Python version required for the library.","package":"python","version":">=3.9","optional":false}],"imports":[{"note":"While `boto3.client(\"controlcatalog\")` works at runtime, importing `ControlCatalogClient` directly from `mypy_boto3_controlcatalog.client` provides the necessary type hints for static analysis and IDE autocomplete.","wrong":"import boto3; client = boto3.client(\"controlcatalog\")","symbol":"ControlCatalogClient","correct":"from mypy_boto3_controlcatalog.client import ControlCatalogClient"},{"note":"It is best practice to wrap stub imports within an `if TYPE_CHECKING:` block to avoid adding the stub package as a runtime dependency.","symbol":"TYPE_CHECKING","correct":"from typing import TYPE_CHECKING"}],"quickstart":{"code":"import os\nfrom typing import TYPE_CHECKING\nimport boto3\n\nif TYPE_CHECKING:\n    from mypy_boto3_controlcatalog.client import ControlCatalogClient\n    from mypy_boto3_controlcatalog.type_defs import ListDomainsOutputTypeDef\n\ndef get_controlcatalog_client() -> \"ControlCatalogClient\":\n    \"\"\"\n    Returns a typed ControlCatalog client.\n    \"\"\"\n    # boto3 automatically uses credentials from environment variables (e.g., AWS_ACCESS_KEY_ID)\n    # or ~/.aws/credentials.\n    # Replace \"us-east-1\" with your desired AWS region.\n    session = boto3.Session(region_name=os.environ.get(\"AWS_REGION\", \"us-east-1\"))\n    client: \"ControlCatalogClient\" = session.client(\"controlcatalog\")\n    return client\n\nif __name__ == \"__main__\":\n    client = get_controlcatalog_client()\n    try:\n        # Example: List Control Catalog domains\n        # Replace with an actual Control Catalog operation for your use case.\n        response: \"ListDomainsOutputTypeDef\" = client.list_domains()\n        print(f\"Successfully listed {len(response.get('Domains', []))} domains.\")\n        for domain in response.get('Domains', []):\n            print(f\"- Domain ARN: {domain.get('Arn')}, Name: {domain.get('Name')}\")\n    except client.exceptions.ClientError as e:\n        print(f\"Error listing domains: {e}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `ControlCatalogClient` using `boto3` and perform a basic operation like `list_domains`. Ensure your AWS credentials and default region are configured in your environment or `~/.aws/credentials` file."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. If you need Python 3.8 support, pin your `mypy-boto3-controlcatalog` version to an older release compatible with builder <8.12.0.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generates `mypy-boto3-*` packages), support for Python 3.8 has been removed across all generated stub packages.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder"},{"fix":"Update your code to reflect the new TypeDef names. Refer to the `mypy-boto3-builder` release notes for exact naming changes if you encounter type errors related to these structures.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes related to TypeDef naming conventions. Specifically, TypeDefs for packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder"},{"fix":"Install `mypy` (`pip install mypy`) or `pyright` (`npm i -g pyright`) and configure it for your project. Run `mypy your_script.py` to check types.","message":"These are type stubs for `boto3`. To benefit from type checking, you must also install a static type checker like `mypy` or `pyright` and configure your project to use it. The stubs alone do not alter `boto3`'s runtime behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"Only `pip install` the `mypy-boto3-` package for each specific AWS service you use. For general `boto3` stubs, `pip install boto3-stubs` is recommended.","message":"For optimal performance and to avoid unnecessary runtime dependencies, it is recommended to install specific service stubs (e.g., `mypy-boto3-controlcatalog`) rather than the monolithic `boto3-stubs[all]` or `mypy-boto3` packages if you only use a few AWS services.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using `boto3-stubs-lite` (if available for your service) or ensure your PyCharm is updated to the latest version. Alternatively, explicit type annotations can sometimes mitigate issues.","message":"When using `mypy-boto3` with PyCharm, older versions of PyCharm might exhibit slow performance or incorrect type inference, especially with `Literal` overloads.","severity":"gotcha","affected_versions":"Some PyCharm versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}