{"id":3099,"library":"mypy-boto3-healthlake","title":"mypy-boto3-healthlake","description":"mypy-boto3-healthlake provides type annotations for the boto3 HealthLake service. It enhances development with static type checking for AWS SDK for Python (boto3) code, catching potential errors early. The current version is 1.42.3, and new versions are released frequently, typically in lockstep with botocore/boto3 updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","Boto3","Type Hinting","Mypy","Stubs","HealthLake"],"install":[{"cmd":"pip install mypy-boto3-healthlake","lang":"bash","label":"Install service-specific stubs"},{"cmd":"pip install mypy-boto3","lang":"bash","label":"Install all boto3 stubs (larger, but covers all services)"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed to run the code.","package":"boto3","optional":false}],"imports":[{"symbol":"HealthLakeClient","correct":"from mypy_boto3_healthlake.client import HealthLakeClient"},{"symbol":"ListFHIRDatastoresPaginator","correct":"from mypy_boto3_healthlake.paginator import ListFHIRDatastoresPaginator"},{"note":"Pre-8.9.0 TypeDef names might have had redundant 'Request' suffixes (e.g., RequestRequestTypeDef). Post-8.9.0, these were often shortened to just 'RequestTypeDef'.","wrong":"from mypy_boto3_healthlake.type_defs import CreateFHIRDatastoreRequestRequestTypeDef","symbol":"CreateFHIRDatastoreRequestRequestTypeDef","correct":"from mypy_boto3_healthlake.type_defs import CreateFHIRDatastoreRequestRequestTypeDef"}],"quickstart":{"code":"import boto3\nimport os\nfrom mypy_boto3_healthlake.client import HealthLakeClient\nfrom mypy_boto3_healthlake.type_defs import CreateFHIRDatastoreRequestRequestTypeDef\n\n# Use os.environ.get for quickstart to satisfy auth check\naws_region = os.environ.get(\"AWS_REGION\", \"us-east-1\")\ndatastore_name = \"my-healthlake-datastore-example\"\ndatastore_type = \"R4\"  # or \"STU3\"\n\nclient: HealthLakeClient = boto3.client(\"healthlake\", region_name=aws_region)\n\nrequest_params: CreateFHIRDatastoreRequestRequestTypeDef = {\n    \"DatastoreName\": datastore_name,\n    \"DatastoreType\": datastore_type\n}\n\ntry:\n    # In a real application, you might add tags or other configurations\n    response = client.create_fhir_datastore(**request_params)\n    print(f\"Datastore creation initiated: {response['DatastoreId']} with status {response['DatastoreStatus']}\")\n    # Wait for the datastore to be active if needed\n    # client.get_waiter('datastore_created').wait(DatastoreId=response['DatastoreId'])\nexcept client.exceptions.ConflictException:\n    print(f\"Datastore '{datastore_name}' already exists.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n# Example of listing datastores\nprint(\"\\nListing HealthLake Datastores:\")\nresponse = client.list_fhir_datastores()\nfor ds in response.get(\"Datastores\", []):\n    print(f\"- {ds['DatastoreName']} ({ds['DatastoreStatus']})\")","lang":"python","description":"This quickstart demonstrates how to initialize a type-hinted HealthLake client, create a FHIR datastore, and list existing datastores. It leverages `mypy-boto3-healthlake` for precise type checking of client methods and request/response TypeDefs."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support was removed in `mypy-boto3-builder` version 8.12.0. All generated `mypy-boto3-*` packages, including `mypy-boto3-healthlake`, now require Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Update your TypeDef import names and annotations to match the new conventions. Consult the `mypy-boto3` documentation for specific service/method changes.","message":"TypeDef naming conventions were significantly changed in `mypy-boto3-builder` version 8.9.0. This includes shortening redundant 'Request' suffixes (e.g., `CreateRequestRequestTypeDef` became `CreateRequestTypeDef`) and moving 'Extra' suffixes. Existing type annotations in your code using older names will break.","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Install `pip install mypy-boto3-<service_name>` for each service you use, or `pip install mypy-boto3` for all services.","message":"Each AWS service requires its own `mypy-boto3-*` package for type stubs (e.g., `mypy-boto3-healthlake` for HealthLake, `mypy-boto3-s3` for S3). If you need types for multiple services, you must install each package individually or install the monorepo `mypy-boto3` package (which is larger).","severity":"gotcha","affected_versions":"all"},{"fix":"Regularly update `mypy-boto3-*` packages: `pip install --upgrade mypy-boto3-healthlake`.","message":"Type stubs are generated based on `botocore` versions. To avoid `mypy` errors due to API mismatches, ensure your `mypy-boto3-*` packages are kept up-to-date and ideally match the `boto3` and `botocore` versions in your environment.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure `mypy` is configured to find third-party stubs (often automatic). If issues arise, check your `mypy` configuration (`pyproject.toml` or `.mypy.ini`) for `mypy_path` or `namespace_packages` settings.","message":"The project migrated to PEP 561 compliant packages in version 8.12.0. While generally an improvement, some users with custom `mypy` configurations or unusual project structures might need to verify `mypy` is correctly discovering the stubs.","severity":"gotcha","affected_versions":">=8.12.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}