{"id":3591,"library":"mypy-boto3-invoicing","title":"Type Annotations for boto3 Invoicing","description":"mypy-boto3-invoicing provides comprehensive type annotations for the AWS boto3 Invoicing service. It offers static type checking compatibility for `boto3.client(\"invoicing\")`, `boto3.resource(\"invoicing\")`, and associated response/request `TypeDefs`, enhancing developer experience with auto-completion and early error detection. The library is automatically generated and regularly updated to reflect the latest boto3 versions.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","mypy","type-stubs","aws","invoicing","typing","developer-tools"],"install":[{"cmd":"pip install mypy-boto3-invoicing boto3 mypy","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This library provides type stubs for boto3; boto3 itself is required for actual AWS interactions.","package":"boto3"},{"reason":"mypy is a static type checker for Python and is typically used to leverage these type annotations.","package":"mypy","optional":true}],"imports":[{"note":"Type stubs for specific services are located within their dedicated mypy-boto3-* package, not directly from the boto3 package or its stubs.","wrong":"from boto3.client import InvoicingClient","symbol":"InvoicingClient","correct":"from mypy_boto3_invoicing.client import InvoicingClient"},{"note":"Response and request type definitions are found in the `type_defs` submodule of the service-specific stub package.","wrong":"from boto3.invoicing.type_defs import GetInvoicesOutputTypeDef","symbol":"GetInvoicesOutputTypeDef","correct":"from mypy_boto3_invoicing.type_defs import GetInvoicesOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_invoicing.client import InvoicingClient\nfrom mypy_boto3_invoicing.type_defs import GetInvoicesOutputTypeDef\n\ndef get_invoices(invoice_id: str) -> GetInvoicesOutputTypeDef:\n    # Using type annotation for the client enables auto-completion and type checking\n    client: InvoicingClient = boto3.client(\"invoicing\")\n    response: GetInvoicesOutputTypeDef = client.get_invoices(InvoiceId=invoice_id)\n    print(f\"Invoice Status: {response.get('Status')}\")\n    return response\n\n# Example usage (replace with actual invoice ID if running)\nif __name__ == \"__main__\":\n    # Invoicing is not a public AWS service, this is a placeholder example.\n    # Replace with actual Invoicing API calls if available or adapt for other boto3 services.\n    try:\n        # This call will likely fail for a non-existent/public 'invoicing' service.\n        # The purpose here is to demonstrate type hinting.\n        result = get_invoices(invoice_id=\"invoice-123\")\n    except Exception as e:\n        print(f\"Caught expected exception for example: {e}\")","lang":"python","description":"This example demonstrates how to obtain a type-hinted Invoicing client and use a specific `TypeDef` for its response. Note that 'invoicing' is generally not a publicly exposed boto3 service, and this example primarily serves to illustrate the type-hinting mechanism for a typical `mypy-boto3` service. For actual AWS services, replace `invoicing` with an available service like `s3` or `ec2`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or later. The `requires_python` metadata is `^=3.9`.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequent releases. Projects using `mypy-boto3` packages must now use Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), all packages generated by it"},{"fix":"Review your code for direct references to `TypeDef` names and update them according to the new naming conventions. Consult the `mypy-boto3` documentation for the specific service for updated `TypeDef` names.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Specifically, `RequestRequestTypeDef` was shortened to `RequestTypeDef` (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and `Extra` postfixes in conflicting TypeDefs were moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 (builder), all packages generated by it"},{"fix":"Ensure `boto3` is installed alongside `mypy-boto3-invoicing` (e.g., `pip install boto3 mypy-boto3-invoicing`).","message":"This library provides *only type stubs* and does not replace the `boto3` library itself. You must install `boto3` separately for your code to function at runtime. `mypy-boto3-invoicing` merely adds static type-checking capabilities.","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"}