Registry /
type-stubs / mypy-boto3-greengrassv2
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GreengrassV2Client
✓ from mypy_boto3_greengrassv2 import GreengrassV2Client
✗ from mypy_boto3_greengrassv2 import GreengrassV2Client
This quickstart demonstrates how to initialize a `boto3` GreengrassV2 client with type hints provided by `mypy-boto3-greengrassv2`. It includes an example of listing Greengrass Core Devices and correctly typing the client and the response, leveraging `TYPE_CHECKING` to prevent runtime dependencies on the stub package.
from typing import TYPE_CHECKING
import boto3
if TYPE_CHECKING:
from mypy_boto3_greengrassv2.client import GreengrassV2Client
from mypy_boto3_greengrassv2.type_defs import ListCoreDevicesResponseTypeDef
def list_greengrass_core_devices() -> ListCoreDevicesResponseTypeDef:
# Initialize a boto3 client (runtime object)
client: GreengrassV2Client = boto3.client("greengrassv2")
# Use the type-hinted client
response: ListCoreDevicesResponseTypeDef = client.list_core_devices()
print("Found Greengrass Core Devices:")
for device in response.get("coreDevices", []):
print(f" - {device.get('coreDeviceThingName')} (ARN: {device.get('coreDeviceArn')})")
return response
if __name__ == "__main__":
# This example requires valid AWS credentials configured in your environment
# (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION environment variables)
try:
list_greengrass_core_devices()
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breaking`mypy-boto3-builder` (which generates this package) removed support for Python 3.8 starting from version 8.12.0. This means `mypy-boto3-greengrassv2` versions generated by `mypy-boto3-builder >= 8.12.0` require Python 3.9 or newer. Projects on Python 3.8 must pin an older version of `mypy-boto3-greengrassv2` or upgrade their Python interpreter.fixUpgrade Python to 3.9+ or pin `mypy-boto3-greengrassv2` to a version compatible with Python 3.8 (e.g., one generated by `mypy-boto3-builder < 8.12.0`).
affects: mypy-boto3-builder >= 8.12.0 (and dependent mypy-boto3-* packages)
breakingStarting with `mypy-boto3-builder 8.9.0`, there were breaking changes to TypeDef naming conventions, such as `CreateDistributionRequestRequestTypeDef` becoming `CreateDistributionRequestTypeDef` and conflicting `Extra` postfixes being moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). Code that explicitly imports and uses these TypeDefs may need adjustment.fixUpdate explicit TypeDef imports and usage to reflect the new naming conventions. Refer to the specific service's documentation or the `mypy-boto3-builder` changelog for details.
affects: mypy-boto3-builder >= 8.9.0 (and dependent mypy-boto3-* packages)
gotchaForgetting to wrap `mypy-boto3-*` imports within an `if TYPE_CHECKING:` block can inadvertently make the stub package a runtime dependency, which is typically undesirable for production deployments.fixAlways use `from typing import TYPE_CHECKING` and wrap stub imports like `if TYPE_CHECKING: from mypy_boto3_greengrassv2.client import GreengrassV2Client` to ensure they are only active during static analysis.
affects: All versions
gotchaWhen using `if TYPE_CHECKING:` blocks for stub imports, `pylint` might complain about undefined variables in the `else` branch. This is because `pylint` may not fully understand the `TYPE_CHECKING` guard.fixTo resolve `pylint` warnings, explicitly set the type-hinted variables to `object` in the `else` branch of the `TYPE_CHECKING` block. For example: `else: GreengrassV2Client = object`.
affects: All versions, specifically when using `pylint`
gotchaConfusion between `boto3-stubs` and `mypy-boto3` packages is common. While `boto3-stubs` was an alternative, `mypy-boto3` (and its specific service packages like `mypy-boto3-greengrassv2`) is the actively maintained and recommended solution for up-to-date and comprehensive type annotations for `boto3`.fixEnsure you are installing `mypy-boto3-greengrassv2` or using the `boto3-stubs[greengrassv2]` extra, and not an older or alternative stub package if you want the latest features and fixes from the `mypy-boto3` ecosystem.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3. The user's code will depend on boto3 at runtime.