Examples#
Index > CloudWatchEvidently > Examples
Auto-generated documentation for CloudWatchEvidently type annotations stubs module mypy-boto3-evidently.
Client#
Implicit type annotations#
Can be used with boto3-stubs[evidently]
package installed.
Write your CloudWatchEvidently
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# CloudWatchEvidentlyClient usage example
from boto3.session import Session
session = Session()
client = session.client("evidently") # (1)
result = client.batch_evaluate_feature() # (2)
- client: CloudWatchEvidentlyClient
- result: BatchEvaluateFeatureResponseTypeDef
Paginator usage example#
# ListExperimentsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("evidently") # (1)
paginator = client.get_paginator("list_experiments") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: CloudWatchEvidentlyClient
- paginator: ListExperimentsPaginator
- item: ListExperimentsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[evidently]
or a standalone mypy_boto3_evidently
package, you have to explicitly specify client: CloudWatchEvidentlyClient
type annotation.
All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.
Client method usage example#
# CloudWatchEvidentlyClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_evidently.client import CloudWatchEvidentlyClient
from mypy_boto3_evidently.type_defs import BatchEvaluateFeatureResponseTypeDef
from mypy_boto3_evidently.type_defs import BatchEvaluateFeatureRequestTypeDef
session = Session()
client: CloudWatchEvidentlyClient = session.client("evidently")
kwargs: BatchEvaluateFeatureRequestTypeDef = {...}
result: BatchEvaluateFeatureResponseTypeDef = client.batch_evaluate_feature(**kwargs)
Paginator usage example#
# ListExperimentsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_evidently.client import CloudWatchEvidentlyClient
from mypy_boto3_evidently.paginator import ListExperimentsPaginator
from mypy_boto3_evidently.type_defs import ListExperimentsResponseTypeDef
session = Session()
client: CloudWatchEvidentlyClient = session.client("evidently")
paginator: ListExperimentsPaginator = client.get_paginator("list_experiments")
for item in paginator.paginate(...):
item: ListExperimentsResponseTypeDef
print(item)