mypy-boto3-omics

1.42.78 · active · verified Sat Apr 11

mypy-boto3-omics provides type annotations for the AWS boto3 Omics service, enhancing developer experience with static type checking, improved IDE autocompletion, and early error detection for Python code. It is currently at version 1.42.78 and is frequently updated to align with boto3 releases, as it's generated by the mypy-boto3-builder project.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-omics` to add type hints to your `boto3` Omics client. It includes importing the `OmicsClient` type, initializing a type-hinted client, and making a sample API call. Remember to replace placeholder values like 'some-store-id' with actual values from your AWS environment. The `TYPE_CHECKING` guard ensures the stub package is only a development dependency.

import boto3
from typing import TYPE_CHECKING

# Recommended: Use TYPE_CHECKING guard to avoid runtime dependency on type stubs
if TYPE_CHECKING:
    from mypy_boto3_omics import OmicsClient
    from mypy_boto3_omics.type_defs import ListReferencesResponseTypeDef

def list_omics_references() -> None:
    # Initialize the Omics client with type hints
    omics_client: OmicsClient = boto3.client("omics")

    print("Listing Omics references...")
    try:
        response: ListReferencesResponseTypeDef = omics_client.list_references(referenceStoreId="some-store-id") # Replace with a valid store ID
        for ref in response.get("references", []):
            print(f"  - Reference: {ref.get('name')}, Status: {ref.get('status')}")
    except omics_client.exceptions.ResourceNotFoundException:
        print("Error: Reference store not found. Please provide a valid referenceStoreId.")
    except Exception as e:
        print(f"An unexpected error occurred: {e}")

if __name__ == "__main__":
    # Ensure boto3 is installed (pip install boto3) and AWS credentials are configured
    # For this example, 'some-store-id' needs to be a valid Omics Reference Store ID
    # in your AWS account and region with appropriate permissions.
    list_omics_references()

view raw JSON →