Registry / type-stubs / types-aiobotocore-textract

types-aiobotocore-textract

JSON →
library3.7.0pypypiunverified

This library provides static type annotations for the `aiobotocore` Textract service client, enhancing code reliability through static type checking with tools like MyPy and Pyright. It is currently at version 3.4.0 and is generated by `mypy-boto3-builder 8.12.0`, receiving frequent updates in sync with new `aiobotocore` releases and builder improvements.

pip install types-aiobotocore-textract
INSTALL
IMPORT
SIG · TYPES-AIOBOTOCORE-
T
types-aiobotocore-textract
type-stubspythonv3.7.0
Install
3.1s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.7.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.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.7MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 3.1s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

TextractClient
from types_aiobotocore_textract import TextractClient
from types_aiobotocore_textract import TextractClient

This quickstart demonstrates how to initialize an `aiobotocore` Textract client and use it with type annotations provided by `types-aiobotocore-textract`. The example calls `analyze_document` with dummy S3 object details. For a successful run, replace `dummy_s3_bucket` and `dummy_s3_key` with actual values pointing to a document in an S3 bucket accessible by your AWS credentials.

import asyncio from aiobotocore.session import get_session from types_aiobotocore_textract.client import TextractClient async def analyze_document_typed(s3_bucket: str, s3_key: str): session = get_session() async with session.create_client("textract") as client: # type: TextractClient print(f"Client type: {type(client)}") try: response = await client.analyze_document( Document={ 'S3Object': { 'Bucket': s3_bucket, 'Name': s3_key } }, FeatureTypes=['FORMS', 'TABLES'] ) print("Document analysis successful.") # Example of accessing a typed response document_metadata = response.get('DocumentMetadata') if document_metadata: print(f"Pages: {document_metadata.get('Pages')}") except client.ValidationException as e: print(f"Validation error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") if __name__ == "__main__": # Replace with your S3 bucket and key for a document (e.g., PDF, PNG, JPG) # This example requires an actual S3 object for Textract to process. # For local testing without a real S3 object, Textract might raise an InvalidS3ObjectException or similar. dummy_s3_bucket = "your-s3-bucket" dummy_s3_key = "path/to/your/document.pdf" # You can use a dummy value if you only want to test type checking without actual execution # or ensure a real, accessible S3 object is configured for Textract. asyncio.run(analyze_document_typed(dummy_s3_bucket, dummy_s3_key))
Debug
Known issues
breakingPython 3.8 support was removed from `mypy-boto3-builder` (which generates these stubs) in version 8.12.0. As `types-aiobotocore-textract 3.4.0` is generated with builder version 8.12.0, it explicitly requires Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or newer. Users on Python 3.8 or older will need to use an older stub version or migrate their Python environment.
affects: >=3.4.0
breakingThe `mypy-boto3-builder` (version 8.9.0 and newer) introduced breaking changes to TypeDef naming conventions. This includes shortening names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving `Extra` postfixes. Code explicitly importing and using these TypeDefs may break.
fix
Review your code for any custom TypeDef imports or direct references that might have been affected by the naming change and update them accordingly. Consult the specific service's `type_defs.pyi` for the correct names.
affects: >=3.4.0
gotchaThese `types-aiobotocore-*` packages provide only type annotations (stubs). They do not replace or include the actual `aiobotocore` runtime library. You must install `aiobotocore` separately for your code to function at runtime.
fix
Ensure `aiobotocore` is installed in your environment alongside the type stubs: `pip install aiobotocore`. For type checking, `mypy` or `pyright` are also required as development dependencies.
affects: all
gotchaThe `mypy-boto3-builder` ecosystem (which includes `types-aiobotocore`) migrated to PEP 561-compliant packages in version 8.12.0. While this generally improves compatibility and discovery, some older tools or custom configurations that relied on previous stub discovery mechanisms might require adjustments.
fix
Ensure your type checker (e.g., MyPy, Pyright) is up-to-date and correctly configured to find PEP 561-style stub packages. Most common setups should work without manual intervention.
affects: >=3.4.0
Upgrade
Version history
3.7.0latest on PyPI · released May 10, 2026
Audit
Dependencies
aiobotocorerequiredThis package provides type stubs for aiobotocore; the actual aiobotocore library is required for runtime functionality.
mypyoptionalRequired for static type checking in a development environment.
pyrightoptionalAlternative static type checker, compatible with these stubs.
Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
3
Resources
types-aiobotocore-textract — pip install types-aiobotocore-textract · libregistry