Type annotations for boto3.CloudWatch 1.14.0 service, generated by mypy-boto3-buider 2.0.4
Project description
mypy-boto3-cloudwatch
Type annotations for boto3.CloudWatch 1.14.0 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.0.4.
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 CloudWatch
service.
python -m pip install boto3-stubs[cloudwatch]
Use boto3
with mypy_boto3_cloudwatch
in your project and enjoy type checking and auto-complete.
import boto3
from mypy_boto3_cloudwatch import CloudWatchClient
# Now mypy can check if your code is valid.
client: CloudWatchClient = boto3.client("cloudwatch")
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: CloudWatchClient = session.client("cloudwatch")
# Do you prefer resource approach? We've got you covered!
from mypy_boto3_cloudwatch import CloudWatchServiceResource
resource: cloudwatch.CloudWatchServiceResource = boto3.resource("cloudwatch")
# Waiters are also supported
import mypy_boto3_cloudwatch.waiter as cloudwatch_waiters
alarm_exists_waiter: cloudwatch_waiters.AlarmExistsWaiter = client.get_waiter("alarm_exists")
composite_alarm_exists_waiter: cloudwatch_waiters.CompositeAlarmExistsWaiter = client.get_waiter("composite_alarm_exists")
# Annotated paginators are included as well
import mypy_boto3_cloudwatch.paginator as cloudwatch_paginators
describe_alarm_history_paginator: cloudwatch_paginators.DescribeAlarmHistoryPaginator = client.get_paginator("describe_alarm_history")
describe_alarms_paginator: cloudwatch_paginators.DescribeAlarmsPaginator = client.get_paginator("describe_alarms")
get_metric_data_paginator: cloudwatch_paginators.GetMetricDataPaginator = client.get_paginator("get_metric_data")
list_dashboards_paginator: cloudwatch_paginators.ListDashboardsPaginator = client.get_paginator("list_dashboards")
list_metrics_paginator: cloudwatch_paginators.ListMetricsPaginator = client.get_paginator("list_metrics")
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_cloudwatch
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
import boto3
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("cloudwatch")
resource = boto3.resource("cloudwatch")
session_client = boto3.Session().client("cloudwatch")
session_resource = boto3.Session().resource("cloudwatch")
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-cloudwatch-1.14.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f82f48ddaf6f6e021888d86ad5949f1b3bd7ea744d5582f31f4ce722044f2a76 |
|
MD5 | 9d69818612b69f3882c3b719cb1a2ee9 |
|
BLAKE2b-256 | e9715e625a98e64f376b99ed3fe0fe2edf654692c0d5900fae59666a20c94e58 |
Hashes for mypy_boto3_cloudwatch-1.14.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 387aef1fe8e5c82a049c3b667e17a9874c5d88345d59315803e27c3701cb7b9b |
|
MD5 | 53028f9ebb4465a98dacefbbf201cf30 |
|
BLAKE2b-256 | ad13960fa0bfa6aecbef94eee327353a685ef6f4d4a361c226ca2288284083fa |