mypy-boto3-cloudfront-keyvaluestore Type Annotations

1.42.3 · active · verified Sat Apr 11

mypy-boto3-cloudfront-keyvaluestore provides type annotations for the boto3 CloudFrontKeyValueStore client, allowing for static type checking with tools like MyPy. It is generated by `mypy-boto3-builder` and its version is synchronized with the corresponding `boto3` and `types-botocore-cloudfront-keyvaluestore` versions. The library receives frequent updates, typically aligning with new boto3 releases and `mypy-boto3-builder` enhancements.

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use the `CloudFrontKeyValueStoreClient` type hint to annotate a boto3 client, enabling static type checking for your CloudFrontKeyValueStore operations.

import boto3
from mypy_boto3_cloudfront_keyvaluestore.client import CloudFrontKeyValueStoreClient

def get_key_value_client() -> CloudFrontKeyValueStoreClient:
    """Gets a typed CloudFront KeyValueStore client."""
    client: CloudFrontKeyValueStoreClient = boto3.client("cloudfront-keyvaluestore")
    return client

# Example usage (requires an AWS setup, e.g., via ~/.aws/credentials)
if __name__ == "__main__":
    try:
        cfkvs_client = get_key_value_client()
        print(f"Successfully created CloudFront KeyValueStore client: {cfkvs_client.meta.region_name}")
        # You can now use cfkvs_client with type hints
        # For example, to list key value stores (if you have any):
        # response = cfkvs_client.list_key_value_stores()
        # print(response)
    except Exception as e:
        print(f"Error creating client: {e}")

view raw JSON →