Skip to content

Examples#

Index > CloudWatchEvidently > Examples

Auto-generated documentation for CloudWatchEvidently type annotations stubs module types-boto3-evidently.

Client#

Implicit type annotations#

Can be used with types-boto3[evidently] package installed.

Write your CloudWatchEvidently code as usual, type checking and code completion should work out of the box.

# CloudWatchEvidentlyClient usage example

from boto3.session import Session


session = Session()

client = session.client("evidently")  # (1)
result = client.batch_evaluate_feature()  # (2)
  1. client: CloudWatchEvidentlyClient
  2. result: BatchEvaluateFeatureResponseTypeDef
# 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)
  1. client: CloudWatchEvidentlyClient
  2. paginator: ListExperimentsPaginator
  3. item: ListExperimentsResponseTypeDef

Explicit type annotations#

With types-boto3-lite[evidently] or a standalone types_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.

# CloudWatchEvidentlyClient usage example with type annotations

from boto3.session import Session

from types_boto3_evidently.client import CloudWatchEvidentlyClient
from types_boto3_evidently.type_defs import BatchEvaluateFeatureResponseTypeDef
from types_boto3_evidently.type_defs import BatchEvaluateFeatureRequestRequestTypeDef


session = Session()

client: CloudWatchEvidentlyClient = session.client("evidently")

kwargs: BatchEvaluateFeatureRequestRequestTypeDef = {...}
result: BatchEvaluateFeatureResponseTypeDef = client.batch_evaluate_feature(**kwargs)
# ListExperimentsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_evidently.client import CloudWatchEvidentlyClient
from types_boto3_evidently.paginator import ListExperimentsPaginator
from types_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)