Registry / type-stubs / mypy-boto3-ecr

mypy-boto3-ecr

JSON →
library1.43.73pypypi✓ verified 23d ago

mypy-boto3-ecr provides type annotations for the AWS Elastic Container Registry (ECR) service client within `boto3`. These stubs allow static type checkers like MyPy to validate usage of ECR API calls, improving code reliability and developer experience. The current version is 1.42.86, and packages are updated frequently, typically in sync with `boto3` and `botocore` releases.

pip install mypy-boto3-ecr
INSTALL
IMPORT
SIG · MYPY-BOTO3-ECR
M
mypy-boto3-ecr
type-stubspythonv1.43.73
Install
1.8s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.73 · 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.000s · 18.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

ECRClient
from mypy_boto3_ecr import ECRClient
from mypy_boto3_ecr import ECRClient

This example demonstrates how to use `mypy-boto3-ecr` to type hint a `boto3` ECR client. It lists your ECR repositories, showing how the `ECRClient` type ensures correct method calls and access to response dict keys.

import boto3 from mypy_boto3_ecr import ECRClient def list_ecr_repos(ecr_client: ECRClient) -> None: """Lists ECR repositories with type hints.""" print(f"Listing ECR repositories in region {ecr_client.meta.region_name}:") try: response = ecr_client.describe_repositories() repositories = response.get('repositories', []) if repositories: for repo in repositories: print(f"- {repo['repositoryName']} (URI: {repo['repositoryUri']})") else: print("No ECR repositories found.") except Exception as e: print(f"Error listing repositories: {e}") if __name__ == "__main__": # Ensure AWS credentials are configured (e.g., via ~/.aws/credentials or env vars) # The actual client object comes from boto3, mypy-boto3-ecr provides the type annotation. ecr_client: ECRClient = boto3.client( "ecr", region_name="us-east-1", aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''), aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', '') ) list_ecr_repos(ecr_client)
Debug
Known issues
breakingPython 3.8 is no longer supported for any `mypy-boto3` packages, including `mypy-boto3-ecr`, as of `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or a later version.
affects: mypy-boto3-builder>=8.12.0, mypy-boto3-ecr>=1.42.86
gotchaThis package only provides type stubs. You must install `boto3` separately for runtime functionality. `mypy-boto3-ecr` does not include the AWS SDK itself.
fix
Ensure `pip install boto3` is executed in your environment alongside `pip install mypy-boto3-ecr`.
affects: All versions
gotchaType stubs are generated for specific `boto3` and `botocore` versions. Mismatches between your installed `boto3` version and the `mypy-boto3-ecr` stubs can lead to incorrect type checking or missing attributes/methods. It's recommended to keep `boto3` and `mypy-boto3-ecr` versions as close as possible.
fix
Periodically update both `boto3` and `mypy-boto3-ecr` (`pip install --upgrade boto3 mypy-boto3-ecr`). Check the `mypy-boto3-builder` release notes for details on which `boto3` version a stub release targets.
affects: All versions
breakingAs of `mypy-boto3-builder` 8.9.0, some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If you manually referenced these types, your code might break.
fix
Update `TypeDef` references in your code to match the new shorter names by inspecting the `.type_defs` module or referring to the `mypy-boto3` documentation.
affects: mypy-boto3-builder>=8.9.0, mypy-boto3-ecr>=1.42.x (corresponding to builder v8.9.0+)
Upgrade
Version history
1.43.73latest on PyPI · released Aug 17, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for which these are type stubs. It must be installed separately.
typing-extensionsoptionalRequired for full type hint compatibility on Python versions older than 3.11, especially for `NotRequired` and `TypeAlias`.
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
2
Resources
mypy-boto3-ecr — pip install mypy-boto3-ecr · libregistry