{"id":3129,"library":"mypy-boto3-resource-groups","title":"Type annotations for boto3 ResourceGroups","description":"mypy-boto3-resource-groups provides static type annotations for the AWS Resource Groups service within `boto3`, enabling robust type checking with tools like MyPy, Pyright, and enhanced IDE auto-completion. It is generated by `mypy-boto3-builder` and is part of a larger ecosystem of stub packages that closely track `boto3` releases, with frequent updates for new services and API changes.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","stubs","resource-groups"],"install":[{"cmd":"pip install mypy-boto3-resource-groups","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install boto3-stubs[resource-groups]","lang":"bash","label":"Install via 'boto3-stubs' extras (recommended for multiple services)"}],"dependencies":[{"reason":"Provides the runtime functionality for AWS SDK calls. These are only type stubs.","package":"boto3"}],"imports":[{"symbol":"ResourceGroupsClient","correct":"from mypy_boto3_resource_groups.client import ResourceGroupsClient"},{"note":"Used for Literal type hints when calling boto3.client directly.","symbol":"ResourceGroupsServiceName","correct":"from mypy_boto3_resource_groups.literals import ResourceGroupsServiceName"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_resource_groups.client import ResourceGroupsClient\nfrom typing import TYPE_CHECKING\n\n# Ensure boto3 is installed (e.g., pip install boto3)\n\n# Standard boto3 client creation\nclient = boto3.client(\"resource-groups\")\n\n# Type hint the client for static analysis (e.g., MyPy, IDEs)\n# The 'if TYPE_CHECKING:' block ensures this import is only for type checking\n# and doesn't cause runtime issues if the stub package isn't installed.\nif TYPE_CHECKING:\n    resource_groups_client: ResourceGroupsClient = client\nelse:\n    resource_groups_client = client\n\n# Now 'resource_groups_client' has full type annotations\n# For example, calling an operation will show expected arguments and return types.\ntry:\n    response = resource_groups_client.list_groups()\n    print(\"Successfully listed Resource Groups.\")\n    # Example: print(response['GroupIdentifiers'])\nexcept Exception as e:\n    print(f\"Error listing Resource Groups: {e}\")","lang":"python","description":"This example demonstrates how to obtain a `boto3` client for AWS Resource Groups and apply explicit type annotations from `mypy-boto3-resource-groups` for improved static analysis and auto-completion. The actual `boto3` library is required at runtime."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version.","message":"Python 3.8 is no longer supported. `mypy-boto3-builder` version 8.12.0 and later, which generates this package, dropped support for Python 3.8. Users must use Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (translates to mypy-boto3-* packages generated by it)"},{"fix":"Update any custom `TypedDict` definitions or manual type hints that rely on previous naming conventions.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. `TypeDef` for packed method arguments use shorter names if possible (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (translates to mypy-boto3-* packages generated by it)"},{"fix":"Ensure `boto3` is installed via `pip install boto3`.","message":"These packages provide *only* type annotations, not runtime functionality. You must have the `boto3` library installed alongside `mypy-boto3-resource-groups` for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type hints, e.g., `client: ResourceGroupsClient = boto3.client('resource-groups')`.","message":"While type discovery often works, explicit type annotations for `boto3.client()` and `boto3.resource()` calls are highly recommended, especially for optimal auto-completion and type checking in IDEs like VSCode and PyCharm.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment and type checker are up-to-date and compatible with PEP 561 stub packages.","message":"Migration to PEP 561 packages in `mypy-boto3-builder` 8.12.0. This is a significant internal packaging change for how type stubs are distributed and discovered by type checkers. While generally beneficial, it might affect custom build pipelines or older environments.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}