Type annotations for boto3.CloudFormation 1.14.9 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-cloudformation
Type annotations for boto3.CloudFormation 1.14.9 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.
mypysupports function overloads as expectedPyCharmalso supports function overloads, but consumes a lot of RAM, use carefully if you have many services installedVSCodedoes 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mypy-boto3-cloudformation-1.14.9.0.tar.gz.
File metadata
- Download URL: mypy-boto3-cloudformation-1.14.9.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f6927c1ffef319e0d95034818fd7098f7ae1616d0bdc586e0f972197d18cc5b
|
|
| MD5 |
3a34985922c7dc4d453b89eeec677936
|
|
| BLAKE2b-256 |
8c14ae3cfc8febee9d7a7386fb1493c6b56395e68be8c10e102b5a0a7acf47a3
|
File details
Details for the file mypy_boto3_cloudformation-1.14.9.0-py3-none-any.whl.
File metadata
- Download URL: mypy_boto3_cloudformation-1.14.9.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1af11a2af1875011e3e175514266f53f01b89601a594dd249c091257d0502187
|
|
| MD5 |
bb3f96442a2c7ac8da73121b92280649
|
|
| BLAKE2b-256 |
13f1f14708d5a418023d12eb5fdd13b1456d17255d84609df0ad64eb3bc39f83
|