mypy-boto3-codeartifact Type Stubs

1.42.3 · active · verified Thu Apr 09

mypy-boto3-codeartifact provides type annotations for the `boto3` AWS CodeArtifact service, enhancing type checking for `boto3` users. It's automatically generated by `mypy-boto3-builder`. The current version is 1.42.3, and it follows a frequent release cadence, often mirroring `boto3` updates and `mypy-boto3-builder`'s own release schedule.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-codeartifact` with `boto3`. You typically import `boto3` as usual, and `mypy` automatically picks up the provided type stubs. For explicit type annotations, you can import specific types like `CodeArtifactClient` from the stub package.

import boto3
from mypy_boto3_codeartifact.client import CodeArtifactClient
from typing import TYPE_CHECKING

# For runtime, you use boto3 as usual
client = boto3.client("codeartifact")

# For type checking, mypy will infer types based on the stubs
# You can also explicitly annotate:
if TYPE_CHECKING:
    typed_client: CodeArtifactClient = boto3.client("codeartifact")
    # Example of a typed call (won't run without AWS credentials & region)
    # try:
    #     domain_response = typed_client.list_domains()
    #     print(domain_response['domains'][0]['name'])
    # except Exception as e:
    #     print(f"Could not list domains: {e}")

print("CodeArtifact client initialized. Type checking will use mypy-boto3-codeartifact stubs.")

view raw JSON →