Registry / type-stubs / mypy-boto3-textract

mypy-boto3-textract

JSON →
library1.43.69pypypi✓ verified 23d ago

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.

pip install mypy-boto3-textract
INSTALL
IMPORT
SIG · MYPY-BOTO3-TEXTRAC
M
mypy-boto3-textract
type-stubspythonv1.43.69
Install
1.7s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.69 · 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.000s · 18.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

TextractClient
from mypy_boto3_textract import TextractClient
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 issues
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.
fix
Upgrade your Python environment to 3.9 or higher to use newer versions of `mypy-boto3-textract`.
affects: >=8.12.0
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.
fix
Update imports and references to the new, shortened TypeDef names. Refer to the specific service's `type_defs.pyi` file (e.g., `mypy_boto3_textract.type_defs`) for corrected names.
affects: >=8.9.0
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.
fix
Verify your `boto3` version (`pip show boto3`) aligns with the range required by `mypy-boto3-textract`. If issues persist, try upgrading `boto3`.
affects: all
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.
fix
Most users will not need to take action. If encountering issues with custom build tools or environments, consult the `mypy-boto3-builder` documentation or upgrade your tooling.
affects: >=8.12.0
Upgrade
Version history
1.43.69latest on PyPI · released Aug 11, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the AWS SDK for Python, which these stubs augment. `mypy-boto3-textract` explicitly depends on a compatible `boto3` version.
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
mypy-boto3-textract — pip install mypy-boto3-textract · libregistry