{"id":3067,"library":"mypy-boto3-cur","title":"Type annotations for boto3 Cost and Usage Report (CUR)","description":"mypy-boto3-cur provides type annotations for the boto3 Cost and Usage Report (CUR) service, ensuring static type checking compatibility for your AWS Python applications. It aligns with the boto3 version 1.42.3 and is generated using mypy-boto3-builder 8.12.0. The library helps catch potential type-related errors at development time.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","types","stubs","cur","cost-and-usage-report","type-hinting"],"install":[{"cmd":"pip install mypy-boto3-cur","lang":"bash","label":"Standalone installation"},{"cmd":"pip install 'boto3-stubs[cur]'","lang":"bash","label":"As part of boto3-stubs (recommended if using multiple services)"}],"dependencies":[{"reason":"Provides the underlying AWS SDK for Python; this library provides its type hints.","package":"boto3"}],"imports":[{"note":"For the typed CUR client.","symbol":"CURClient","correct":"from mypy_boto3_cur.client import CURClient"},{"note":"For paginator type definitions. Specific paginator types will vary by method.","symbol":"CostandUsageReportServicePaginatorTypeDef","correct":"from mypy_boto3_cur.paginators import CostandUsageReportServicePaginatorTypeDef"},{"note":"For service-specific exception type definitions.","symbol":"ReportLimitExceededExceptionTypeDef","correct":"from mypy_boto3_cur.type_defs import ReportLimitExceededExceptionTypeDef"},{"note":"For service-specific data structure type definitions (TypedDicts).","symbol":"ReportDefinitionTypeDef","correct":"from mypy_boto3_cur.type_defs import ReportDefinitionTypeDef"},{"note":"For service-specific literal string types.","symbol":"ReportFormatType","correct":"from mypy_boto3_cur.literals import ReportFormatType"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_cur.client import CURClient\nfrom mypy_boto3_cur.type_defs import DescribeReportDefinitionsResponseTypeDef\nimport os\n\ndef get_cur_client() -> CURClient:\n    \"\"\"Returns a typed CUR client.\"\"\"\n    session = boto3.Session(region_name=os.environ.get('AWS_REGION', 'us-east-1'))\n    client: CURClient = session.client(\"cur\")\n    return client\n\ndef list_cur_definitions():\n    \"\"\"Lists Cost and Usage Report definitions with type hints.\"\"\"\n    cur_client = get_cur_client()\n    response: DescribeReportDefinitionsResponseTypeDef = cur_client.describe_report_definitions()\n    print(\"Report Definitions:\")\n    for report in response.get(\"ReportDefinitions\", []):\n        print(f\"  - {report['ReportName']} (Status: {report['ReportStatus']})\")\n\nif __name__ == \"__main__\":\n    # Ensure AWS credentials/region are configured in environment or ~/.aws/credentials\n    # For example: export AWS_REGION='us-east-1'\n    # To run this, you would typically need 'boto3' installed alongside 'mypy-boto3-cur'\n    list_cur_definitions()","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted CUR client and use it to list report definitions. Explicit type annotations on the client and response objects leverage the type stubs for improved autocompletion and static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later. The `requires_python` metadata for the package is `>=3.9`.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generated this package), support for Python 3.8 was removed across all `mypy-boto3` packages. Ensure your project targets Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.0 (package)"},{"fix":"Review and update `TypeDef` imports and usage in your codebase to match the new, streamlined naming conventions, especially if upgrading from older `mypy-boto3` versions.","message":"Major version `8.9.0` of `mypy-boto3-builder` introduced breaking changes to `TypeDef` naming conventions for method arguments (e.g., `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef`) and postfix ordering (`Extra` moved to end). While not specific to CUR, such changes apply generally to generated services.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Add explicit type hints for your boto3 clients and resources: `client: CURClient = session.client(\"cur\")`.","message":"For optimal autocompletion and type inference in some IDEs (e.g., VSCode), it is recommended to explicitly type annotate `boto3.Session().client('service_name')` calls with the `Client` type from the specific `mypy-boto3-<service>` package (e.g., `client: CURClient = session.client('cur')`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `boto3` is installed: `pip install boto3`.","message":"This library provides type stubs for `boto3`. You must have `boto3` itself installed in your environment for the runtime functionality. This `mypy-boto3-cur` package is purely for static type checking.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}