Registry /
type-stubs / mypy-boto3-payment-cryptography
Install & Compatibility
Where this runs
tested against v1.43.24 · 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.
PaymentCryptographyControlPlaneClient
✓ from mypy_boto3_payment_cryptography import PaymentCryptographyControlPlaneClient
✗ from mypy_boto3_payment_cryptography import PaymentCryptographyControlPlaneClient
This quickstart demonstrates how to initialize a `PaymentCryptographyControlPlaneClient` with type hints and how to use a `TypeDef` for request parameters. The `if TYPE_CHECKING:` block ensures that `mypy-boto3-payment-cryptography` is only a development dependency. The example attempts to create a key in AWS Payment Cryptography Control Plane.
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_payment_cryptography.client import PaymentCryptographyControlPlaneClient
from mypy_boto3_payment_cryptography.type_defs import CreateKeyInputRequestTypeDef
def create_payment_cryptography_key():
# The 'client' variable will be type-checked as PaymentCryptographyControlPlaneClient
client: 'PaymentCryptographyControlPlaneClient' = boto3.client(
'payment-cryptography-control-plane'
)
key_alias = "alias/my-test-key"
# Example of using a TypedDict for a request payload
create_key_params: CreateKeyInputRequestTypeDef = {
"KeyAttributes": {
"KeyUsage": "TR31_K0_CARD_PROCESSING_EMV_COMPATIBILITY",
"KeyClass": "SYMMETRIC_KEY",
"KeyAlgorithm": "AES_128",
"KeyModesOfUse": {
"Encrypt": True,
"Decrypt": True
}
},
"Enabled": True,
"KeyCheckValueAlgorithm": "CMAC"
}
try:
response = client.create_key(**create_key_params)
print(f"Key created successfully with ARN: {response['Key']['KeyArn']}")
# Type checkers will understand the structure of 'response'
except client.exceptions.ConflictException:
print(f"Key alias {key_alias} already exists.")
except Exception as e:
print(f"An error occurred: {e}")
# To run this example, ensure you have AWS credentials configured
# or set environment variables like AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION.
# Example: os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1')
create_payment_cryptography_key()
Debug
Known issues
breakingPython 3.8 support has been removed. `mypy-boto3-builder` version 8.12.0 (which generated this stub) and consequently this stub package now require Python 3.9 or newer. Ensure your environment meets this requirement.fixUpgrade your Python environment to 3.9 or a newer supported version.
affects: mypy-boto3-builder >=8.12.0, mypy-boto3-payment-cryptography >=1.42.83
breakingIn `mypy-boto3-builder` version 8.9.0, some generated `TypeDef` names were shortened or had conflicting postfixes moved for consistency (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While this specific stub is newer, direct usage of `TypeDef` names from older generated versions may break.fixReview your code for direct imports or references to `TypeDef` objects. Update their names according to the latest generated types if you were using specific, potentially verbose, `TypeDef` names.
affects: mypy-boto3-builder >=8.9.0
gotchaThis package provides type stubs for the **Payment Cryptography Control Plane** service. If you are looking for type annotations for the **Payment Cryptography Data Plane** service, you need to install `mypy-boto3-payment-cryptography-data` instead.fixEnsure you are installing the correct stub package (`mypy-boto3-payment-cryptography` for Control Plane, `mypy-boto3-payment-cryptography-data` for Data Plane) based on the AWS Payment Cryptography API you intend to use.
affects: All
gotchaIt is best practice to wrap `mypy-boto3` stub imports within an `if TYPE_CHECKING:` block. This prevents the stub packages from being imported at runtime, making them purely development dependencies and avoiding potential runtime issues or increased startup times in production environments.fixModify your imports from `from mypy_boto3_... import ...` to include a conditional block:
`from typing import TYPE_CHECKING`
`if TYPE_CHECKING:`
`from mypy_boto3_payment_cryptography.client import PaymentCryptographyControlPlaneClient`
And then use a forward reference for type hints: `client: 'PaymentCryptographyControlPlaneClient' = boto3.client(...)`. affects: All
Upgrade
Version history
1.43.24latest on PyPI · released Jun 5, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK for Python, which these stubs type-hint.