Type annotations for boto3.CloudWatch 1.13.26 service, generated by mypy-boto3-buider 2.0.4
Project description
mypy-boto3-cloudwatch
Type annotations for boto3.CloudWatch 1.13.26 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.13.26.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f6f80e522e597a5ebf29076b7106bbfdf67b24edf79fbee68b14a245be04c67 |
|
MD5 | 63e32d511bde9279f8e1414aac874fff |
|
BLAKE2b-256 | cf38ceeadd9c14e3636646f778297e6ef865cfe19f11e346f825c6970ad05a71 |
Hashes for mypy_boto3_cloudwatch-1.13.26.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 217a8f917713d593c4b56a4c712a4cbb6d409e0c51a2aa1d1f48a981d2fe1143 |
|
MD5 | 7bee9921b2328b8abcd34fa4bac7b398 |
|
BLAKE2b-256 | 3293305d3f94df4c85fb3f648f732c26c65cfcbb52526129a2c21836dd3e0466 |