Skip to main content

Getting Started

Installation

pip install capo-healthlake

Usage

from capo_healthlake import AsyncHealthLakeClient


async def main():
    async with AsyncHealthLakeClient() as health_lake:
        # Example: call the create_fhir_datastore operation
        response = await health_lake.create_fhir_datastore()
        print(response["datastore_id"])

Pagination

Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.

from capo_healthlake import AsyncHealthLakeClient


async def main():
    async with AsyncHealthLakeClient() as health_lake:
        # Example: paginate over list_fhir_datastores
        async for item in health_lake.iter_list_fhir_datastores():
            print(item)

Error Handling

The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.

from capo_healthlake import AsyncHealthLakeClient
from capo_healthlake.error import AccessDeniedException


async def main():
    async with AsyncHealthLakeClient() as health_lake:
        try:
            await health_lake.create_fhir_datastore()
        except AccessDeniedException as e:
            print(f"Error: {e}")
            print(e.data)  # additional error data

Retrying

The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.

The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.

from capo_healthlake import AsyncHealthLakeClient


async def main():
    async with AsyncHealthLakeClient() as health_lake:
        # Default: 3 attempts for every operation
        response = await health_lake.create_fhir_datastore()

        # Override per operation
        response = await health_lake.create_fhir_datastore(config_overrides={"retry_max_attempts": 5})

        # Disable retries for this call
        response = await health_lake.create_fhir_datastore(config_overrides={"retry_max_attempts": 1})

Release files for capo-healthlake 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capo-healthlake 0.1.0
File Size Uploaded
capo_healthlake-0.1.0.tar.gz 71.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capo-healthlake 0.1.0
File Interpreter ABI Platform
capo_healthlake-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 210.0 kB

Release files / capo_healthlake-0.1.0.tar.gz

Download URL capo_healthlake-0.1.0.tar.gz
Size 71.7 kB
Tags Source
SHA-256 checksum
How to use checksums
58be3c13abe80273acf51aa46fcad562dc30e97cb027062433471f314ada38f7
BLAKE2b-256 checksum
How to use checksums
980506d2986f5308cf1f161f927b6b440a118986b1fa21a1d0f3210059ca56c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / capo_healthlake-0.1.0-py3-none-any.whl

Download URL capo_healthlake-0.1.0-py3-none-any.whl
Size 138.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
834df8992436e5e7dd27bb0522c91aecc814ec295a9b63f337c5ab9e1c33e3c7
BLAKE2b-256 checksum
How to use checksums
2e08cbcc8648eac98559e6624e81cb9cec5a7dca9dde0e3c2e1012d0814cd5fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page