Type annotations for boto3.CloudFormation 1.14.46 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-cloudformation
Type annotations for boto3.CloudFormation 1.14.46 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.2.0.
More information can be found on boto3-stubs page.
How to install
Make sure you have mypy installed and activated in your IDE.
Install boto3-stubs
for CloudFormation
service.
python -m pip install boto3-stubs[cloudformation]
How to use
Client annotations
CloudFormationClient
provides annotations for boto3.client("cloudformation")
.
import boto3
from mypy_boto3_cloudformation import CloudFormationClient, CloudFormationServiceResource
from mypy_boto3_cloudformation.paginator import (
DescribeAccountLimitsPaginator,
DescribeChangeSetPaginator,
DescribeStackEventsPaginator,
DescribeStacksPaginator,
ListChangeSetsPaginator,
ListExportsPaginator,
ListImportsPaginator,
ListStackInstancesPaginator,
ListStackResourcesPaginator,
ListStackSetOperationResultsPaginator,
ListStackSetOperationsPaginator,
ListStackSetsPaginator,
ListStacksPaginator,
)
from mypy_boto3_cloudformation.service_resource import (
Event,
ServiceResourceStacksCollection,
Stack,
StackResource,
StackResourceSummary,
)
from mypy_boto3_cloudformation.type_defs import AccountGateResultTypeDef, ...
from mypy_boto3_cloudformation.waiter import (
ChangeSetCreateCompleteWaiter,
StackCreateCompleteWaiter,
StackDeleteCompleteWaiter,
StackExistsWaiter,
StackImportCompleteWaiter,
StackRollbackCompleteWaiter,
StackUpdateCompleteWaiter,
TypeRegistrationCompleteWaiter,
)
client: CloudFormationClient = boto3.client("cloudformation")
# now client usage is checked by mypy and IDE should provide code auto-complete
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: CloudFormationClient = session.client("cloudformation")
Paginators annotations
mypy_boto3_cloudformation.paginator
module contains type annotations for all paginators.
client: CloudFormationClient = boto3.client("cloudformation")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
describe_account_limits_paginator: DescribeAccountLimitsPaginator = client.get_paginator("describe_account_limits")
describe_change_set_paginator: DescribeChangeSetPaginator = client.get_paginator("describe_change_set")
describe_stack_events_paginator: DescribeStackEventsPaginator = client.get_paginator("describe_stack_events")
describe_stacks_paginator: DescribeStacksPaginator = client.get_paginator("describe_stacks")
list_change_sets_paginator: ListChangeSetsPaginator = client.get_paginator("list_change_sets")
list_exports_paginator: ListExportsPaginator = client.get_paginator("list_exports")
list_imports_paginator: ListImportsPaginator = client.get_paginator("list_imports")
list_stack_instances_paginator: ListStackInstancesPaginator = client.get_paginator("list_stack_instances")
list_stack_resources_paginator: ListStackResourcesPaginator = client.get_paginator("list_stack_resources")
list_stack_set_operation_results_paginator: ListStackSetOperationResultsPaginator = client.get_paginator("list_stack_set_operation_results")
list_stack_set_operations_paginator: ListStackSetOperationsPaginator = client.get_paginator("list_stack_set_operations")
list_stack_sets_paginator: ListStackSetsPaginator = client.get_paginator("list_stack_sets")
list_stacks_paginator: ListStacksPaginator = client.get_paginator("list_stacks")
Waiters annotations
mypy_boto3_cloudformation.waiter
module contains type annotations for all waiters.
client: CloudFormationClient = boto3.client("cloudformation")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
change_set_create_complete_waiter: ChangeSetCreateCompleteWaiter = client.get_waiter("change_set_create_complete")
stack_create_complete_waiter: StackCreateCompleteWaiter = client.get_waiter("stack_create_complete")
stack_delete_complete_waiter: StackDeleteCompleteWaiter = client.get_waiter("stack_delete_complete")
stack_exists_waiter: StackExistsWaiter = client.get_waiter("stack_exists")
stack_import_complete_waiter: StackImportCompleteWaiter = client.get_waiter("stack_import_complete")
stack_rollback_complete_waiter: StackRollbackCompleteWaiter = client.get_waiter("stack_rollback_complete")
stack_update_complete_waiter: StackUpdateCompleteWaiter = client.get_waiter("stack_update_complete")
type_registration_complete_waiter: TypeRegistrationCompleteWaiter = client.get_waiter("type_registration_complete")
Service Resource annotations
CloudFormationServiceResource
provides annotations for boto3.resource("cloudformation")
.
resource: CloudFormationServiceResource = boto3.resource("cloudformation")
# now resource usage is checked by mypy and IDE should provide code auto-complete
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_resource: CloudFormationServiceResource = session.resource("cloudformation")
Other resources annotations
mypy_boto3_cloudformation.service_resource
module contains type annotations for all resources.
resource: CloudFormationServiceResource = boto3.resource("cloudformation")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
my_event: Event = resource.Event(...)
my_stack: Stack = resource.Stack(...)
my_stack_resource: StackResource = resource.StackResource(...)
my_stack_resource_summary: StackResourceSummary = resource.StackResourceSummary(...)
Collections annotations
mypy_boto3_cloudformation.service_resource
module contains type annotations
for all CloudFormationServiceResource
collections.
resource: CloudFormationServiceResource = boto3.resource("cloudformation")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
stacks: cloudformation_resources.ServiceResourceStacksCollection = resource.stacks
Typed dictionations
mypy_boto3_cloudformation.type_defs
module contains structures and shapes assembled
to typed dictionaries for additional type checking.
def get_structure() -> AccountGateResultTypeDef:
return {
...
}
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_cloudformation
and other installed services.
# Run this command after you add or remove service packages
python -m mypy_boto3
Generated type annotations provide overloads for boto3.client
and boto3.resource
,
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 carefully if you have many services installedVSCode
does not currently support function overloads, use explicit type annotations
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("cloudformation")
resource = boto3.resource("cloudformation")
session_client = boto3.Session().client("cloudformation")
session_resource = boto3.Session().resource("cloudformation")
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-cloudformation-1.14.46.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6dfd0830c4092e49bc006140dc79cd42508c94588f3fbf6a9e32642b3ad7aa0 |
|
MD5 | e1ceb9aaa56608cdaf08912ac9f82449 |
|
BLAKE2b-256 | 607d89a794689fa44994befe7d49cd928fc96e90aa5001729614d65014b0a826 |
Hashes for mypy_boto3_cloudformation-1.14.46.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8abc0e24b8ab357fbc0e959a482a8cf243a475380edcc26a98b7de293db44076 |
|
MD5 | 007cf05b728ceb00798c29c4076e4aec |
|
BLAKE2b-256 | 523d05a1016216ff584f3e01c7b37674d63664a747daf11b7945a8110e46f9a8 |