Registry / type-stubs / mypy-boto3-textract

mypy-boto3-textract

JSON →
library1.42.3pypypiunverified

mypy-boto3-textract provides a complete set of type annotations for the boto3 Textract service. These stubs enable static type checking for boto3 client operations, improving code quality and developer experience by catching type-related errors at development time. It is generated by the mypy-boto3-builder project and typically releases new versions in sync with boto3 updates, currently at 1.42.3.

type-stubsaws
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
glibc
py 3.10
4/5 runs
4/5 runs
py 3.11
4/5 runs
4/5 runs
py 3.12
4/5 runs
4/5 runs
py 3.13
4/5 runs
4/5 runs
py 3.9
4/5 runs
4/5 runs
Code
Verified usage

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

from mypy_boto3_textract import TextractClient

This quickstart demonstrates the core functionality of `mypy-boto3-textract`: obtaining a type-hinted `boto3` client for the Textract service. It showcases the import of the `TextractClient` type and its application when creating a `boto3.client` instance, enabling comprehensive static analysis of Textract operations without requiring live AWS credentials for the type-checking benefit itself.

import boto3 from mypy_boto3_textract.client import TextractClient from mypy_boto3_textract.type_defs import AnalyzeDocumentResponseTypeDef, DocumentTypeDef # Import for detailed typing def get_typed_textract_client() -> TextractClient: """ Demonstrates how to obtain a type-hinted Textract client. The actual boto3 client is created, and the `TextractClient` type stub provides static analysis for its methods. """ # boto3 automatically handles authentication via environment variables # (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) or other credential providers. # No explicit os.environ.get is typically needed here for the stubs to function, # as they primarily assist static analysis, not runtime credential fetching. client: TextractClient = boto3.client("textract", region_name="us-east-1") # Specify region for a valid client print(f"Successfully obtained a type-hinted Textract client: {type(client)}") # You can now use 'client' with full type-hinting support # For example, client.analyze_document(...) return client if __name__ == '__main__': typed_client = get_typed_textract_client() # At this point, `typed_client` has all the type hints for the Textract service, # enabling static analysis in your IDE or with mypy. # A live call (e.g., typed_client.analyze_document(...)) would require # valid AWS credentials and appropriate permissions at runtime.
Debug
Known footguns
breakingSupport for Python 3.8 was officially removed with `mypy-boto3-builder` version 8.12.0. Consequently, `mypy-boto3-textract` versions generated by this builder or newer will not support Python 3.8.
breakingType definition (TypeDef) names were shortened and modified in `mypy-boto3-builder` version 8.9.0. This caused changes like `CreateDistributionRequestRequestTypeDef` becoming `CreateDistributionRequestTypeDef`. Code directly importing or referencing these specific TypeDef names will break.
gotchaEnsure your `boto3` runtime package version is compatible with `mypy-boto3-textract`. While `mypy-boto3-textract` specifies `boto3` as a dependency, explicitly managing `boto3` versions (e.g., `boto3>=1.42.0,<2.0.0`) can prevent unexpected type-checking or runtime errors if mismatches occur.
gotchaAll `mypy-boto3` packages, including `mypy-boto3-textract`, migrated to PEP 561 compliance (marked with `py.typed`) in `mypy-boto3-builder` version 8.12.0. While this is an improvement for type checkers, older build systems or custom tooling might require updates to properly handle this new package structure.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
Resources