Registry / type-stubs / mypy-boto3-ecs

mypy-boto3-ecs

JSON →
library1.43.65pypypi✓ verified 23d ago

mypy-boto3-ecs provides type annotations for the AWS boto3 ECS (Elastic Container Service) client, resources, and paginators. It is part of the `mypy-boto3` project, which generates stubs for all boto3 services. The current version is 1.42.88, with frequent releases synchronized with new `boto3` versions and `mypy-boto3-builder` updates.

pip install boto3 mypy-boto3-ecs mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-ECS
M
mypy-boto3-ecs
type-stubspythonv1.43.65
Install
6.1s avg
Import
745ms
Disk
115MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.65 · 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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.782s · 117.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.1s · import 0.708s · 115MB
115MB installed
● package 115MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ECSClient
from mypy_boto3_ecs.client import ECSClient
ECSResource
from mypy_boto3_ecs.service_resource import ECSResource
ListClustersPaginator
from mypy_boto3_ecs.paginator import ListClustersPaginator
Paginators are service-specific and located in the `paginator` submodule.

This example demonstrates how to use `mypy-boto3-ecs` with `boto3` to gain static type checking for the ECS client. The `TYPE_CHECKING` block ensures that type-specific imports do not affect runtime behavior. You need to run `mypy your_script.py` to see the benefits.

import boto3 from mypy_boto3_ecs.client import ECSClient from typing import TYPE_CHECKING # Ensure boto3 is installed: pip install boto3 mypy-boto3-ecs if TYPE_CHECKING: # This block is only for type checking, not runtime execution client: ECSClient = boto3.client("ecs") # Example usage with type hints response = client.list_clusters() for cluster in response.get("clusters", []): print(f"Cluster ARN: {cluster.get('clusterArn')}") else: # Runtime code without explicit type hints (mypy will still check) client = boto3.client("ecs") response = client.list_clusters() for cluster in response.get("clusters", []): print(f"Cluster Name: {cluster.get('clusterName')}")
Debug
Known issues
breakingPython 3.8 support has been removed for all `mypy-boto3` packages with `mypy-boto3-builder` version 8.12.0 and above. Ensure your environment uses Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-ecs 1.42.88+)
gotcha`mypy-boto3-ecs` provides only type stubs. You must install `boto3` separately for your code to run. It's a common mistake to install only the stub package.
fix
Always `pip install boto3 mypy-boto3-ecs` (or `aiobotocore`/`aioboto3` for async stubs).
affects: All versions
breakingTypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Specifically, argument TypeDefs use shorter names, and conflicting TypeDef `Extra` postfixes were moved. This might require updating type annotation references in your codebase.
fix
Review `mypy` errors and adjust TypeDef names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-ecs versions generated by this builder version)
gotchaThe `mypy-boto3` stub packages, including `mypy-boto3-ecs`, migrated to PEP 561 compliance with `mypy-boto3-builder` 8.12.0. While this is an improvement for type checker discovery, some legacy tools or build systems might need minor adjustments.
fix
Ensure your type checker (e.g., mypy) is up-to-date. No direct code changes are typically required unless you have specific, custom stub loading configurations.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-ecs 1.42.88+)
gotchaThese stubs are designed for use with `mypy`. While other type checkers might work, `mypy` is the primary target and often yields the most accurate results.
fix
Use `mypy` for type checking. Install with `pip install mypy` and run `mypy your_script.py`.
affects: All versions
Upgrade
Version history
1.43.65latest on PyPI · released Aug 5, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself must be installed to run the code.
mypyrequiredmypy is required to perform static type checking using these stubs.
Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
1
Resources