Registry / type-stubs / mypy-boto3-cloudfront

mypy-boto3-cloudfront

JSON →
library1.43.76pypypi✓ verified 23d ago

mypy-boto3-cloudfront provides type annotations for the AWS boto3 CloudFront service. It enhances development experience with static type checking, auto-completion, and early error detection in IDEs and with tools like mypy. This package, version 1.42.80, is generated with `mypy-boto3-builder 8.12.0` and receives frequent updates in sync with `boto3` releases.

pip install mypy-boto3-cloudfront
INSTALL
IMPORT
SIG · MYPY-BOTO3-CLOUDFR
M
mypy-boto3-cloudfront
type-stubspythonv1.43.76
Install
2.9s avg
Import
785ms
Disk
51MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.76 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.822s · 52.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.9s · import 0.748s · 53MB
51MB installed
● package 51MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CloudFrontClient
from mypy_boto3_cloudfront.client import CloudFrontClient
from mypy_boto3_cloudfront import CloudFrontClient
Client
from mypy_boto3_cloudfront.client import Client
ServiceResource
from mypy_boto3_cloudfront import ServiceResource

This example demonstrates how to initialize a `boto3` CloudFront client with type hints and retrieve a list of distributions. It uses `TYPE_CHECKING` for conditional imports, ensuring the stub package is only a development dependency. The response items are type-hinted using a `DistributionSummaryTypeDef`.

import boto3 from typing import TYPE_CHECKING if TYPE_CHECKING: from mypy_boto3_cloudfront.client import CloudFrontClient from mypy_boto3_cloudfront.type_defs import DistributionSummaryTypeDef # Instantiate a boto3 client (type-hinted for mypy) cloudfront_client: 'CloudFrontClient' = boto3.client('cloudfront') # Example: List distributions with type-hinted response try: response = cloudfront_client.list_distributions() distributions: list['DistributionSummaryTypeDef'] = response.get('DistributionList', {}).get('Items', []) if distributions: print(f"Found {len(distributions)} CloudFront distributions.") for dist in distributions: print(f" Distribution ID: {dist.get('Id')}, Domain Name: {dist.get('DomainName')}") else: print("No CloudFront distributions found.") except Exception as e: print(f"Error listing distributions: {e}")
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-cloudfront 1.42.80`), support for Python 3.8 has been removed. Projects using this version of the stubs or newer require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0, mypy-boto3-cloudfront >= 1.42.80 (generated by 8.12.0)
breakingBuilder version 8.9.0 introduced breaking changes to TypeDef naming conventions. For instance, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`. If you're explicitly using these full TypeDef names, they may need to be updated.
fix
Update your code to use the new, shorter TypeDef names. Refer to the specific service's documentation for exact TypeDef names.
affects: mypy-boto3-builder >= 8.9.0, mypy-boto3-cloudfront >= 1.42.80 (generated by 8.12.0)
gotchaThe version of `mypy-boto3-cloudfront` typically aligns with the `boto3` version it provides stubs for (e.g., `1.42.80` for `boto3==1.42.80`). Using significantly mismatched `boto3` and `mypy-boto3-*` versions can lead to type checking errors or missing type hints if API signatures have changed between versions.
fix
Ensure your `boto3` and `mypy-boto3-cloudfront` package versions are as closely aligned as possible, ideally using the same major and minor version numbers where applicable.
affects: All versions
gotchaWhen using explicit type annotations, some IDEs (like VSCode without full function overload support) may require explicitly importing `Client` types and `TypeDef` structures. While `mypy` and PyCharm might infer types more readily, explicit imports ensure consistent behavior across tools.
fix
For maximum compatibility and clarity, explicitly import `CloudFrontClient` and any `TypeDef`s from `mypy_boto3_cloudfront.client` and `mypy_boto3_cloudfront.type_defs` respectively. Consider using `if TYPE_CHECKING:` for development-only dependencies.
affects: All versions
Upgrade
Version history
1.43.76latest on PyPI · released Aug 20, 2026
Audit
Dependencies
boto3optionalThis package provides type stubs for the `boto3` library; `boto3` must be installed separately for runtime functionality.
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources