Registry / type-stubs / mypy-boto3-comprehendmedical

mypy-boto3-comprehendmedical

JSON →
library1.43.0pypypi✓ verified 23d ago

mypy-boto3-comprehendmedical provides comprehensive type annotations (stubs) for the boto3 ComprehendMedical client. Generated by `mypy-boto3-builder`, this package enhances development with static type checking, improved IDE auto-completion, and early error detection for your AWS ComprehendMedical interactions. It closely tracks `boto3` releases, with the current version being 1.42.3, compatible with boto3 1.42.3 and generated by builder 8.12.0.

pip install mypy-boto3-comprehendmedical boto3 mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-COMPREH
M
mypy-boto3-comprehendmedical
type-stubspythonv1.43.0
Install
6.1s avg
Import
586ms
Disk
114MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.600s · 116.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.1s · import 0.572s · 114MB
114MB installed
● package 114MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ComprehendMedicalClient
from mypy_boto3_comprehendmedical.client import ComprehendMedicalClient
from boto3.client import ComprehendMedicalClient
Directly importing from boto3 will not provide the enhanced type hints for the client object.
DetectEntitiesV2ResponseTypeDef
from mypy_boto3_comprehendmedical.type_defs import DetectEntitiesV2ResponseTypeDef
from boto3.comprehendmedical.type_defs import DetectEntitiesV2ResponseTypeDef
Type definition imports come from the stub package, not directly from boto3 or botocore.

This quickstart demonstrates how to initialize a type-hinted ComprehendMedical client and use one of its methods, `detect_entities_v2`. It uses `TYPE_CHECKING` for conditional imports, ensuring the stubs are only active during type checking.

import boto3 from typing import TYPE_CHECKING from mypy_boto3_comprehendmedical.client import ComprehendMedicalClient from mypy_boto3_comprehendmedical.type_defs import DetectEntitiesV2ResponseTypeDef if TYPE_CHECKING: client: ComprehendMedicalClient = boto3.client("comprehendmedical") else: client = boto3.client("comprehendmedical") # Example usage with type-hinted client def process_medical_text(text: str) -> DetectEntitiesV2ResponseTypeDef: try: response: DetectEntitiesV2ResponseTypeDef = client.detect_entities_v2( Text=text ) print(f"Detected entities: {len(response['Entities'])}") return response except client.exceptions.ClientError as e: print(f"Error processing text: {e}") raise # Example call medical_note = "Patient has a history of type 2 diabetes and hypertension." if __name__ == "__main__": # In a real application, you'd handle AWS credentials/region configuration # or use boto3's default credential chain. # For this example, ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials) try: result = process_medical_text(medical_note) # Further processing of result, e.g., result['Entities'][0]['Text'] except Exception as e: print(f"An error occurred during quickstart: {e}")
Debug
Known issues
breakingPython 3.8 support was removed for `mypy-boto3-builder` version 8.12.0 and later, which generated this package version. Consequently, `mypy-boto3-comprehendmedical` 1.42.3 and newer versions require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer. If you must use Python 3.8, pin your `mypy-boto3-comprehendmedical` version to an older compatible release.
affects: 1.42.3+
breakingThe `mypy-boto3-builder` (version 8.12.0+) migrated to PEP 561 compliant packages. This change might affect how some tools or older `mypy` versions discover and use the stubs if your `mypy` configuration is not up-to-date or if you relied on older stub discovery mechanisms (e.g., specific `MYPYPATH` configurations for non-installed stubs).
fix
Ensure `mypy` is up-to-date and that stub packages are installed in the same Python environment used by `mypy`. Avoid relying on `MYPYPATH` for stub-only packages; they should be installed via `pip`.
affects: 1.42.3+
gotchaThis package provides type stubs, not the actual runtime implementation of `boto3`. You must install `boto3` separately for your code to function at runtime.
fix
Always install `boto3` alongside `mypy-boto3-comprehendmedical` (e.g., `pip install boto3 mypy-boto3-comprehendmedical`).
affects: All
gotchaThe type hints provided by this library are only utilized by static type checkers (like `mypy`) and IDEs (like VSCode, PyCharm) for analysis and auto-completion. They do not enforce types at runtime.
fix
Integrate `mypy` into your CI/CD pipeline or use it during development (`mypy your_project/`). Ensure your IDE is configured to use type checking (e.g., Pylance in VSCode, Mypy plugin in PyCharm).
affects: All
gotchaFor accurate type checking, the version of `mypy-boto3-comprehendmedical` should ideally match the version of `boto3` you are using. Mismatched versions can lead to incorrect type hints or missing attributes if `boto3` introduces changes not yet reflected in the stubs.
fix
Regularly update both `boto3` and its corresponding `mypy-boto3-comprehendmedical` stub package. Consider pinning versions in your `requirements.txt` (e.g., `boto3==1.42.3`, `mypy-boto3-comprehendmedical==1.42.3`).
affects: All
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides the underlying AWS SDK runtime functionality that these stubs annotate.
mypyrequiredRequired for static type checking of Python code using these stubs.
pythonrequiredMinimum Python version required by the package.
Agent activity
23 hits · last 30 days
node
19
OpenAI (training)
2
Resources
mypy-boto3-comprehendmedical — pip install mypy-boto3-comprehendmedical · libregistry