Install & Compatibility
Where this runs
tested against v1.43.53 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.616s · 116.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.0s · import 0.564s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InvoicingClient
✓ from mypy_boto3_invoicing.client import InvoicingClient
✗ from boto3.client import InvoicingClient
Type stubs for specific services are located within their dedicated mypy-boto3-* package, not directly from the boto3 package or its stubs.
GetInvoicesOutputTypeDef
✓ from mypy_boto3_invoicing.type_defs import GetInvoicesOutputTypeDef
✗ from boto3.invoicing.type_defs import GetInvoicesOutputTypeDef
Response and request type definitions are found in the `type_defs` submodule of the service-specific stub package.
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`.
import boto3
from mypy_boto3_invoicing.client import InvoicingClient
from mypy_boto3_invoicing.type_defs import GetInvoicesOutputTypeDef
def get_invoices(invoice_id: str) -> GetInvoicesOutputTypeDef:
# Using type annotation for the client enables auto-completion and type checking
client: InvoicingClient = boto3.client("invoicing")
response: GetInvoicesOutputTypeDef = client.get_invoices(InvoiceId=invoice_id)
print(f"Invoice Status: {response.get('Status')}")
return response
# Example usage (replace with actual invoice ID if running)
if __name__ == "__main__":
# Invoicing is not a public AWS service, this is a placeholder example.
# Replace with actual Invoicing API calls if available or adapt for other boto3 services.
try:
# This call will likely fail for a non-existent/public 'invoicing' service.
# The purpose here is to demonstrate type hinting.
result = get_invoices(invoice_id="invoice-123")
except Exception as e:
print(f"Caught expected exception for example: {e}")
Debug
Known issues
breakingSupport 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.fixUpgrade your Python environment to 3.9 or later. The `requires_python` metadata is `^=3.9`.
affects: >=8.12.0 (builder), all packages generated by it
breakingIn `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`).fixReview 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.
affects: >=8.9.0 (builder), all packages generated by it
gotchaThis 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.fixEnsure `boto3` is installed alongside `mypy-boto3-invoicing` (e.g., `pip install boto3 mypy-boto3-invoicing`).
affects: All versions
Upgrade
Version history
1.43.53latest on PyPI · released Jul 21, 2026
Audit
Dependencies
boto3requiredThis library provides type stubs for boto3; boto3 itself is required for actual AWS interactions.
mypyoptionalmypy is a static type checker for Python and is typically used to leverage these type annotations.