Install & Compatibility
Where this runs
tested against v1.43.11 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.604s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.562s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ManagedGrafanaClient
✓ from mypy_boto3_grafana.client import ManagedGrafanaClient
Import the client type directly for explicit type hinting.
ListWorkspacesResponseTypeDef
✓ from mypy_boto3_grafana.type_defs import ListWorkspacesResponseTypeDef
Import specific TypedDicts for response or request structures.
This quickstart demonstrates how to use the `mypy-boto3-grafana` type annotations with a boto3 client. It explicitly types the client and a response object, allowing `mypy` to catch potential type mismatches.
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_grafana.client import ManagedGrafanaClient
from mypy_boto3_grafana.type_defs import ListWorkspacesResponseTypeDef
def get_grafana_workspaces():
# In a real application, consider using environment variables or other secure methods for credentials
client: ManagedGrafanaClient = boto3.client("grafana")
# Example: List AWS Grafana workspaces
response: ListWorkspacesResponseTypeDef = client.list_workspaces()
for workspace in response.get("workspaces", []):
print(f"Workspace Name: {workspace.get('workspaceName')}, Status: {workspace.get('workspaceStatus')}")
if __name__ == "__main__":
get_grafana_workspaces()
# To type-check this file: mypy your_script_name.py
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0, support for Python 3.8 was removed. Projects using older Python versions must pin to an older `mypy-boto3-grafana` version generated by a builder prior to 8.12.0 or upgrade their Python version.fixUpgrade to Python 3.9+ or pin `mypy-boto3-grafana` to a version compatible with Python 3.8 (e.g., versions generated by `mypy-boto3-builder < 8.12.0`).
affects: >=8.12.0 of mypy-boto3-builder (which generates mypy-boto3-grafana)
breakingVersion 8.9.0 of `mypy-boto3-builder` introduced breaking changes in TypeDef naming conventions, potentially causing import errors or type mismatches if you were explicitly referencing generated TypedDicts with the old naming scheme.fixReview your code for explicit TypeDef imports and update names according to the new conventions (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`, `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).
affects: >=8.9.0 of mypy-boto3-builder (and generated stubs)
gotchaWhile some IDEs (like PyCharm) and `mypy` can infer types for `boto3.client` calls, explicit type annotations (e.g., `client: ManagedGrafanaClient = boto3.client("grafana")`) are often recommended for optimal autocompletion and comprehensive type checking, especially when using VSCode or the `boto3-stubs-lite` packages.fixAdd explicit type annotations for boto3 client, resource, waiter, and paginator objects, as shown in the quickstart example.
affects: All
gotchaPylint may complain about undefined variables when using `typing.TYPE_CHECKING` guards. This is a known issue with Pylint's static analysis when types are only defined conditionally.fixAs a workaround, you can assign `object` to the type-hinted variables outside the `TYPE_CHECKING` block: `if TYPE_CHECKING: from mypy_boto3_grafana.client import ManagedGrafanaClient else: ManagedGrafanaClient = object`.
affects: All, with Pylint
gotchaPyCharm users might experience slow performance or high CPU usage due to how it handles `Literal` overloads. This can be particularly noticeable with comprehensive stub packages like `mypy-boto3-grafana`.fixIt is recommended to use `boto3-stubs-lite` (e.g., `mypy-boto3-grafana-lite` if available, or `boto3-stubs-lite[grafana]`) or disable PyCharm's internal type checker and rely solely on `mypy` or `pyright` instead.
affects: All, with PyCharm
Upgrade
Version history
1.43.11latest on PyPI · released May 19, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK for Python. These are type stubs for boto3.
mypyoptionalStatic type checker that utilizes these annotations.