Type annotations for boto3 HealthImaging

1.42.81 · active · verified Sat Apr 11

mypy-boto3-medical-imaging provides type annotations for the `boto3` HealthImaging (Medical Imaging) service. It allows static type checkers like MyPy to validate usage of `boto3` clients, resources, and session methods, enhancing code quality and developer experience. The current version is 1.42.81, and new versions are released frequently, typically mirroring `boto3` releases or `mypy-boto3-builder` updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a type-hinted `boto3` HealthImaging client and perform a basic operation (listing image sets). It highlights importing the specific client type and a response type definition for improved static analysis.

import boto3
from mypy_boto3_medical_imaging.client import HealthImagingClient
from mypy_boto3_medical_imaging.type_defs import ListImageSetsOutputTypeDef

# Ensure you have boto3 installed and configured for AWS access
# Example for a typed HealthImaging client
client: HealthImagingClient = boto3.client("health-imaging")

try:
    # List image sets in a data store
    response: ListImageSetsOutputTypeDef = client.list_image_sets(datastoreId="YOUR_DATASTORE_ID")
    print(f"Successfully listed {len(response.get('imageSets', []))} image sets.")
    if response.get('imageSets'):
        print(f"First image set ID: {response['imageSets'][0]['imageSetId']}")
except client.exceptions.ResourceNotFoundException:
    print("Data store not found. Please provide a valid datastoreId.")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →