Registry / type-stubs / mypy-boto3-cloudhsmv2

mypy-boto3-cloudhsmv2

JSON →
library1.43.0pypypi✓ verified 23d ago

mypy-boto3-cloudhsmv2 provides type annotations (stubs) for the `boto3` AWS SDK, specifically for the CloudHSMV2 service. It enhances development experience by enabling static type checking for `boto3` clients and responses. The library is currently at version 1.42.3, with releases closely mirroring `boto3` service updates and more frequent updates for the underlying `mypy-boto3-builder`.

pip install mypy-boto3-cloudhsmv2
INSTALL
IMPORT
SIG · MYPY-BOTO3-CLOUDHS
M
mypy-boto3-cloudhsmv2
type-stubspythonv1.43.0
Install
3.7s avg
Import
Disk
232MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 198.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.7s · import 0.000s · 267MB
232MB installed
● package 232MB
Code
Verified usage

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

CloudHSMV2Client
from mypy_boto3_cloudhsmv2 import CloudHSMV2Client
from mypy_boto3_cloudhsmv2 import CloudHSMV2Client

This example demonstrates how to use `mypy-boto3-cloudhsmv2` for type-hinted interaction with the CloudHSMV2 service. It shows how to obtain a type-annotated client and call an operation (`describe_clusters`), with type checkers verifying argument and return types. For actual execution, ensure AWS credentials are configured in your environment.

import boto3 from mypy_boto3_cloudhsmv2.client import CloudHSMV2Client from mypy_boto3_cloudhsmv2.type_defs import DescribeClustersResponseTypeDef import os # For example credentials def get_cloudhsmv2_clusters() -> None: # Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials) # For this example to run without errors, ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, # and AWS_REGION are set in your environment if not using IAM roles or config files. # The type annotation helps type checkers understand the client's methods and return types. client: CloudHSMV2Client = boto3.client("cloudhsmv2", region_name=os.environ.get('AWS_REGION', 'us-east-1')) try: response: DescribeClustersResponseTypeDef = client.describe_clusters() print("Successfully described CloudHSM V2 clusters:") for cluster in response.get('Clusters', []): print(f" - Cluster ID: {cluster.get('ClusterId')}, State: {cluster.get('State')}") except Exception as e: print(f"Error describing clusters: {e}") if __name__ == "__main__": # This code requires valid AWS credentials to run successfully. # For type checking, simply running `mypy your_script.py` is sufficient. get_cloudhsmv2_clusters()
Debug
Known issues
breakingSupport for Python 3.8 was removed in version 8.12.0 of the `mypy-boto3-builder` and subsequently in generated packages like `mypy-boto3-cloudhsmv2`.
fix
Upgrade your Python environment to 3.9 or higher. For Python 3.8 support, pin to a version <8.12.0 if compatible with your boto3 version.
affects: >=8.12.0
breakingTypeDef naming conventions changed in version 8.9.0 (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This can break code that explicitly imports or references these generated type definition names.
fix
Review your code for direct references to `mypy-boto3` generated TypedDict names and update them according to the new conventions. Consult the specific service's `mypy-boto3` package `type_defs.pyi` for current names.
affects: >=8.9.0
gotchaThis library provides *type stubs* for `boto3`, it does not include `boto3` itself. You must install `boto3` separately to actually run your code.
fix
Ensure `boto3` is installed in your environment: `pip install boto3`.
affects: All
gotchaFor effective type checking, the version of `mypy-boto3-cloudhsmv2` should closely match the `boto3` version you are using. Mismatched versions can lead to incorrect type hints or missing attributes.
fix
Ideally, align `mypy-boto3-cloudhsmv2` with your `boto3` version. `mypy-boto3` packages are typically generated to match specific `boto3` versions (as indicated in their summary/description).
affects: All
gotchaTo benefit from these type annotations, you need to use a static type checker like `mypy`. Simply installing the stubs will not magically add type checking to your runtime Python code.
fix
Install `mypy` (or another compatible type checker) with `pip install mypy` and integrate it into your development workflow (e.g., `mypy your_script.py`).
affects: All
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis library provides type annotations for boto3; boto3 itself is required for actual runtime.
typing-extensionsoptionalProvides backports of type hinting features; a runtime dependency for older Python versions or specific features.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
mypy-boto3-cloudhsmv2 — pip install mypy-boto3-cloudhsmv2 · libregistry