Textractor is a Python package designed to simplify the use of AWS Textract services for document analysis. It provides a higher-level abstraction over the AWS SDK (boto3) to easily extract text, forms, tables, and other data from documents. The library is actively maintained, with frequent minor releases to address bugs and introduce new features.
pip install amazon-textract-textractorVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Textractor client, process a PDF document located in an S3 bucket using `start_document_analysis` to extract forms and tables, and then print the extracted data. Ensure your AWS credentials and default region are configured for boto3.
Review any code that processes Textractor's HTML output and relies on consistent IDs between the `TABLE` block and the `LAYOUT_TABLE` representation. Adjust your parsing logic to account for this ID divergence if necessary.
For local PDF processing, always install with `pip install amazon-textract-textractor[pdf]`. If you encounter errors, verify `pypdfium2` is correctly installed and working. If `pdf2image` is used, ensure Poppler is installed and correctly configured in your system's PATH.
Ensure your AWS credentials are correctly configured for `boto3` (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION` environment variables, or `~/.aws/credentials` file). Always specify `region_name` in the `Textractor` constructor, matching the region where your S3 buckets are located and where Textract is available.
Increase the `polling_interval` or `timeout` parameters when calling `start_document_analysis` or `start_document_text_detection` for very large documents if you experience timeouts. Be aware of Textract service limits regarding document size and number of pages.
Install the module using 'pip install amazon-textract-textractor'.
Use the correct import statement: 'from textractor import Textractor'.
Install the Poppler package and ensure its binaries are in the system's PATH.
Verify the S3 object's path and ensure the necessary permissions are set for Amazon Textract to access it.
Convert the document to a supported format before processing it with Amazon Textract.