Install & Compatibility
Where this runs
tested against v1.43.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.7MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ECRPublicClient
✓ from mypy_boto3_ecr_public.client import ECRPublicClient
✗ from mypy_boto3_ecr_public import ECRPublicClient
ECRPublicServiceResource
✓ from mypy_boto3_ecr_public.service_resource import ECRPublicServiceResource
ServiceResource
✓ from mypy_boto3_ecr_public.service_resource import ServiceResource
This quickstart demonstrates how to use `mypy-boto3-ecr-public` to get type annotations for the ECR Public client and list public repositories. It shows explicit type hinting for the boto3 client.
import boto3
from mypy_boto3_ecr_public.client import ECRPublicClient
from typing import TYPE_CHECKING
if TYPE_CHECKING:
# Only import for type checking, avoid runtime dependency if not strictly needed
# Or, rely on the installed mypy-boto3-ecr-public for runtime type discovery
pass
def list_public_repositories(region: str = "us-east-1") -> None:
client: ECRPublicClient = boto3.client("ecr-public", region_name=region)
try:
response = client.describe_repositories()
print(f"Public ECR Repositories in {region}:")
for repo in response.get("repositories", []):
print(f" - {repo['repositoryName']} (URI: {repo['repositoryUri']})")
except Exception as e:
print(f"Error listing repositories: {e}")
if __name__ == "__main__":
# Note: AWS credentials (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
# or ~/.aws/credentials are required for boto3 to function.
list_public_repositories()
Debug
Known issues
breakingSupport for Python 3.8 and older versions has been removed. The library now requires Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder 8.12.0 and later (which generates mypy-boto3-ecr-public 1.42.3+)
breakingThe package structure has migrated to PEP 561 compliance. While this generally improves compatibility, ensure your type checker is up-to-date and configured correctly.fixUpdate your type checker (e.g., mypy, pyright) to the latest version and verify your configuration. No direct code change is typically required unless you had custom type-stub handling.
affects: mypy-boto3-builder 8.12.0 and later
breakingTypeDef naming conventions for packed method arguments and conflicting names have changed. For example, `CreateDistributionRequestRequestTypeDef` might become `CreateDistributionRequestTypeDef`, and `Extra` postfixes were moved.fixReview and update `TypedDict` imports and usage in your code if you were relying on specific generated TypeDef names.
affects: mypy-boto3-builder 8.9.0 and later
gotchaThis library provides *type stubs* only. You must also install `boto3` (e.g., `pip install boto3`) for your code to run at runtime and interact with AWS.fixEnsure `boto3` is installed in your environment alongside `mypy-boto3-ecr-public`.
affects: All versions
gotchaPyCharm users might experience slow performance or high CPU usage due to Literal overloads. The project maintainers recommend using `boto3-stubs-lite` or disabling PyCharm's type checker in such cases.fixConsider `pip install boto3-stubs-lite[ecr-public]` for a lighter version, or configure PyCharm to use external type checkers like mypy/pyright instead of its built-in one for this library.
affects: All versions with PyCharm
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3optionalThe runtime library for which these are type stubs. Required for actual execution of AWS calls.
boto3-stubs-corerequiredCore components for boto3 type stubs, installed automatically with mypy-boto3-ecr-public.