Type annotations for boto3 ApplicationCostProfiler
mypy-boto3-applicationcostprofiler provides type annotations for the boto3 ApplicationCostProfiler service, generated with mypy-boto3-builder. It enhances development with type checking and autocomplete for AWS SDK for Python (boto3) clients. The library is actively maintained with frequent releases, typically in sync with boto3 and botocore updates.
Warnings
- breaking Python 3.8 support has been removed since mypy-boto3-builder 8.12.0 (which generated this package). Users on Python 3.8 will experience errors as `mypy` and `typeshed` no longer support it.
- breaking The builder migrated to PEP 561 compliant packages with version 8.12.0. This might affect how some tools or legacy environments interpret the stub packages.
- breaking Starting with mypy-boto3-builder 8.9.0, TypeDef names for packed method arguments became shorter (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).
- gotcha Some IDEs (like VSCode with older Python extensions) may require explicit type annotations for `boto3.client()` or `boto3.session.client()` calls to get full autocomplete and type checking, as function overloads might not be fully supported by the IDE's language server.
- gotcha Pylint might complain about undefined variables when using `TYPE_CHECKING` conditional imports. This is a known issue in Pylint's static analysis.
Install
-
pip install mypy-boto3-applicationcostprofiler -
pip install 'boto3-stubs[applicationcostprofiler]'
Imports
- ApplicationCostProfilerClient
from mypy_boto3_applicationcostprofiler.client import ApplicationCostProfilerClient
- ApplicationCostProfilerServiceName
from mypy_boto3_applicationcostprofiler.type_defs import ApplicationCostProfilerServiceName
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_applicationcostprofiler.client import ApplicationCostProfilerClient
from mypy_boto3_applicationcostprofiler.type_defs import ListReportDefinitionsOutputTypeDef
def get_app_cost_profiler_client() -> ApplicationCostProfilerClient:
"""Returns a typed ApplicationCostProfiler client."""
return boto3.client('applicationcostprofiler')
client = get_app_cost_profiler_client()
try:
# Example operation: List report definitions
response: ListReportDefinitionsOutputTypeDef = client.list_report_definitions()
print(f"Successfully listed {len(response.get('reportDefinitions', []))} report definitions.")
except client.exceptions.ClientError as e:
print(f"Error listing report definitions: {e}")