Registry / type-stubs / mypy-boto3-amp

mypy-boto3-amp

JSON →
library1.43.62pypypi✓ verified 23d ago

mypy-boto3-amp provides PEP 561 compatible type annotations for `boto3`'s PrometheusService (Amazon Managed Service for Prometheus, AMP) client. It enhances developer experience by enabling static type checking and autocompletion for `boto3` code with tools like mypy, pyright, VSCode, and PyCharm. The library is actively maintained, with frequent updates in sync with `boto3` versions, and is currently at version 1.42.3, generated with mypy-boto3-builder 8.12.0.

pip install mypy-boto3-amp boto3 mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-AMP
M
mypy-boto3-amp
type-stubspythonv1.43.62
Install
7.8s avg
Import
599ms
Disk
116MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.62 · 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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.624s · 118.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.8s · import 0.573s · 116MB
116MB installed
● package 116MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrometheusServiceClient
from mypy_boto3_amp import PrometheusServiceClient
ListWorkspacesPaginator
from mypy_boto3_amp.paginator import ListWorkspacesPaginator
For type-hinting paginator objects.
CreateWorkspaceRequestRequestTypeDef
from mypy_boto3_amp.type_defs import CreateWorkspaceRequestRequestTypeDef
For explicit type annotations of method arguments and return values.

This quickstart demonstrates how to initialize a `boto3` client for Amazon Managed Service for Prometheus (AMP) with `mypy-boto3-amp` type annotations. It shows how to import and apply the `PrometheusServiceClient` type to get full type checking and autocompletion for client methods and their arguments/return values. Remember to have `boto3` and `mypy` installed in your environment.

import boto3 from mypy_boto3_amp import PrometheusServiceClient from mypy_boto3_amp.type_defs import CreateWorkspaceRequestRequestTypeDef import os # Boto3 client without type annotations # untyped_client = boto3.client("amp") # response = untyped_client.list_workspaces() # Boto3 client with type annotations client: PrometheusServiceClient = boto3.client("amp") # Example usage with type-hinted client print("Listing AMP workspaces...") try: # Using a method that typically exists for AMP clients response = client.list_workspaces() print(f"Found {len(response.get('workspaces', []))} workspaces.") # Example of creating a workspace with typed dictionary (requires a unique name) # create_params: CreateWorkspaceRequestRequestTypeDef = { # "alias": f"my-typed-workspace-{os.environ.get('UNIQUE_ID', 'test')}" # } # create_response = client.create_workspace(**create_params) # print(f"Created workspace with ID: {create_response['workspaceId']}") except client.exceptions.ResourceNotFoundException: print("No AMP workspaces found or permissions issue.") except Exception as e: print(f"An error occurred: {e}") # Run mypy to check types: # mypy your_script_name.py
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generates these stubs), Python 3.8 is no longer supported. Projects using Python 3.8 must upgrade to Python 3.9 or newer to use the latest `mypy-boto3` stubs. The packages also migrated to PEP 561 compliance.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-amp >= 1.42.0)
breakingVersion 8.9.0 of `mypy-boto3-builder` introduced breaking changes to `TypeDef` naming conventions. `TypeDefs` for packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes are moved to the end. This may require updating explicit type annotations in existing code.
fix
Review and update `TypeDef` import paths and names in your codebase according to the new conventions.
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-amp >= 1.35.0 or similar)
gotchaPyCharm users might experience slow performance and high CPU usage, especially with `Literal` overloads, due to a known PyCharm issue (PY-40997). It is recommended to either use `boto3-stubs-lite` (if explicit type annotations are acceptable) or to disable PyCharm's built-in type checker and rely on `mypy` or `pyright` for type checking.
fix
Consider `pip install boto3-stubs-lite[amp]` or configure PyCharm to use external type checkers like `mypy` or `pyright`.
affects: All versions, specific to PyCharm IDE.
gotchaWhile `mypy-boto3-amp` provides type annotations for `boto3`'s AMP client, `boto3` itself is a separate runtime dependency and must be installed in your environment. These packages are type stubs, not the actual AWS SDK.
fix
Ensure both `boto3` and `mypy-boto3-amp` are installed: `pip install boto3 mypy-boto3-amp`.
affects: All versions
deprecatedThe `mypy-boto3` ecosystem has seen service name changes, such as `sms-voice` being deprecated in favor of `pinpoint-sms-voice` in `mypy-boto3-builder` 8.11.0. While not directly affecting AMP, this highlights that AWS service names can change, leading to deprecations in stub packages. Always verify service names against current AWS documentation.
fix
Consult `boto3-stubs` documentation for the correct and up-to-date service module names.
affects: mypy-boto3-builder >= 8.11.0 (general warning for related packages)
Upgrade
Version history
1.43.62latest on PyPI · released Jul 31, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for the `boto3` library; `boto3` itself must be installed for runtime execution.
mypyoptionalA static type checker that utilizes these type annotations. Other type checkers like `pyright` can also be used.
Agent activity
28 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
mypy-boto3-amp — pip install mypy-boto3-amp · libregistry