types-aiobotocore-logs
raw JSON → 3.5.0 verified Mon Apr 27 auth: no python
Type annotations for aiobotocore CloudWatchLogs 3.5.0 service, generated by mypy-boto3-builder 8.12.0. Used to provide static type checking for aiobotocore's CloudWatch Logs client. Requires Python >=3.9.
pip install types-aiobotocore-logs Common errors
error ModuleNotFoundError: No module named 'types_aiobotocore_logs' ↓
cause Trying to import from the package name directly instead of the correct module namespace.
fix
Use 'from mypy_boto3_logs import ...' instead.
error ImportError: cannot import name 'CloudWatchLogsClient' from 'types_aiobotocore_logs' ↓
cause Incorrect import path; the client class is in mypy_boto3_logs.
fix
Change to 'from mypy_boto3_logs import CloudWatchLogsClient'.
Warnings
breaking Version 8.9.0 of mypy-boto3-builder renamed packed TypeDefs by removing redundant 'Request' suffix, which may break existing type imports. types-aiobotocore-logs 3.5.0 is built with builder 8.12.0, so TypeDef names like 'CreateLogGroupRequestRequestTypeDef' became 'CreateLogGroupRequestTypeDef'. Update any hardcoded type references. ↓
fix Use the shorter TypeDef names (e.g., 'CreateLogGroupRequestTypeDef' instead of 'CreateLogGroupRequestRequestTypeDef').
gotcha Do NOT import directly from 'types_aiobotocore_logs'. The package provides types under the 'mypy_boto3_logs' namespace. Direct imports from 'types_aiobotocore_logs' will fail with ModuleNotFoundError. ↓
fix Use 'from mypy_boto3_logs import ...' for clients and 'from mypy_boto3_logs.type_defs import ...' for type definitions.
deprecated Python 3.8 support was removed in builder version 8.12.0. types-aiobotocore-logs 3.5.0 requires Python >=3.9. ↓
fix Upgrade to Python 3.9+ to use this version.
Imports
- CloudWatchLogsClient wrong
from types_aiobotocore_logs import CloudWatchLogsClientcorrectfrom mypy_boto3_logs import CloudWatchLogsClient - LogGroupTypeDef wrong
from types_aiobotocore_logs.type_defs import LogGroupTypeDefcorrectfrom mypy_boto3_logs.type_defs import LogGroupTypeDef
Quickstart
import os
import aiobotocore.session
from mypy_boto3_logs import CloudWatchLogsClient
async def main():
session = aiobotocore.session.get_session()
async with session.create_client('logs', region_name='us-east-1') as client:
response: CloudWatchLogsClient.describe_log_groups()
print(response)