Type annotations for boto3.KMS 1.13.24 service, generated by mypy-boto3-buider 2.0.2
Project description
mypy-boto3-kms
Type annotations for boto3.KMS 1.13.24 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.0.2.
More information can be found on boto3-stubs page.
How to use
Make sure you have mypy installed and activated in your IDE.
Install boto3-stubs
for KMS
service.
python -m pip install boto3-stubs[kms]
# update installed packages index for automated type discovery
python -m mypy_boto3
Use boto3
with mypy_boto3_kms
in your project and enjoy type checking and auto-complete.
import boto3
from mypy_boto3_kms import KMSClient
# Now mypy can check if your code is valid.
client: KMSClient = boto3.client("kms")
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: KMSClient = session.client("kms")
# Annotated paginators are included as well
import mypy_boto3_kms.paginator as kms_paginators
list_aliases_paginator: kms_paginators.ListAliasesPaginator = client.get_paginator("list_aliases")
list_grants_paginator: kms_paginators.ListGrantsPaginator = client.get_paginator("list_grants")
list_key_policies_paginator: kms_paginators.ListKeyPoliciesPaginator = client.get_paginator("list_key_policies")
list_keys_paginator: kms_paginators.ListKeysPaginator = client.get_paginator("list_keys")
Automated type discovery
mypy_boto3
package can generate index for mypy_boto3_kms
and other installed services.
# Run this command when you add or remove service packages
python -m mypy_boto3
Generated index provides overloads for boto3.client
and boto3.service
,
boto3.Session.client
and boto3.Session.resource
functions,
so explicit type annotations are not needed.
mypy
supports function overloads as expectedPyCharm
also supports function overloads, but consumes a lot of RAM, use carefullyVSCode
does not currently support function overloads
Also, generated index allows you to import types from mypy_boto3
:
# you can replace imports
import mypy_boto3_kms as kms
from mypy_boto3_kms import KMSClient
# with these
from mypy_boto3 import kms
from mypy_boto3.kms import KMSClient
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mypy_boto3_kms-1.13.24.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3912244b40468f5eb94cb07222732ee9299d77506c81d6c2e6fa13fecb1e62a8 |
|
MD5 | d1c7082b4c6fce371b4bcf9cf6a04033 |
|
BLAKE2b-256 | 541947bb2c613690983f995dd546e03234ecae9c28bce0ba0353d4b5cf82746f |