Registry / aws / amazon-textract-caller

amazon-textract-caller

JSON →
library0.2.4pypypi✓ verified 22d ago

This library provides a simplified Python interface for making API calls to Amazon Textract, streamlining direct Textract interactions. As of its latest PyPI release (0.2.4), it primarily focuses on facilitating raw API requests and responses. However, active development has largely shifted to the `amazon-textract-textractor` library, which offers more comprehensive document parsing and utility features. The `amazon-textract-caller` package itself has not seen updates since January 2021.

pip install amazon-textract-caller
INSTALL
IMPORT
SIG · AMAZON-TEXTRACT-CA
A
amazon-textract-caller
awspythonv0.2.4
Install
4.3s avg
Import
730ms
Disk
52MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.4 · 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.754s · 53.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.3s · import 0.706s · 54MB
52MB installed
● package 52MB
Code
Verified usage

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

call_textract
from textractcaller import call_textract
from amazon_textract_caller import get_textract_response
Textract_API
from textractcaller import Textract_API
get_full_json
from textractcaller import get_full_json

This quickstart demonstrates how to use `amazon-textract-caller` to invoke the Amazon Textract API for a document stored in S3. It will return the raw JSON response from Textract. Ensure your AWS credentials and region are configured (e.g., via environment variables or AWS CLI).

import os from amazon_textract_caller import get_textract_response, TextractFeatures # Configure AWS credentials and region (e.g., via environment variables or AWS CLI config) # os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', '') # os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', '') # os.environ['AWS_DEFAULT_REGION'] = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1') # Replace with your actual S3 document URI (e.g., "s3://your-bucket/your-document.pdf") s3_document_uri = "s3://YOUR_BUCKET/YOUR_DOCUMENT.pdf" try: # Call Textract API with specified features # This package returns the raw JSON response from Textract. response = get_textract_response( input_document=s3_document_uri, features=[TextractFeatures.FORMS, TextractFeatures.TABLES] ) print("Textract API call successful. Raw JSON response received:") # print(response) # Uncomment to see the full raw Textract JSON response print(f"Detected {len(response.get('Blocks', []))} blocks.") print("\nNote: For higher-level parsing and object models, consider the `amazon-textract-textractor` library.") except Exception as e: print(f"Error during Textract API call: {e}") print("Ensure valid AWS credentials, correct S3 URI, and appropriate permissions.")
Debug
Known issues
breakingThe `amazon-textract-caller` PyPI package (version 0.2.4) has not been updated since January 2021 and is effectively abandoned as a standalone package. Its functionality has been largely superseded and extended by the actively maintained `amazon-textract-textractor` library (v1.x), which resides in the same GitHub repository.
fix
For new projects, or if needing current features, bug fixes, or higher-level parsing, it is strongly recommended to migrate to the `amazon-textract-textractor` library. This package might not be compatible with newer Textract API features or `boto3` versions.
affects: 0.2.4 and older
gotchaThis library is primarily a direct wrapper for the Textract API, returning raw Textract JSON responses. It does not provide the higher-level parsing, data extraction, and convenient object model utilities (like accessing forms or tables as Python objects) that are available in the `amazon-textract-textractor` library.
fix
If advanced document parsing, structured data extraction (e.g., easy access to key-value pairs, tables, or entity recognition), and an object-oriented representation of the document are required, consider `amazon-textract-textractor` for a more feature-rich experience.
affects: 0.2.4 and older
gotchaThis library relies on `boto3` for AWS API calls, which requires properly configured AWS credentials (e.g., via environment variables like `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, or AWS CLI configuration). Textract API calls incur costs based on usage.
fix
Ensure your AWS environment is correctly configured with valid credentials and permissions for Textract. Regularly monitor your AWS Textract usage and associated costs in the AWS console.
affects: All versions
Upgrade
Version history
0.2.4latest on PyPI · released Jun 20, 2024
Audit
Dependencies
boto3requiredRequired for interacting with AWS Textract API.
Agent activity
34 hits · last 30 days
node
28
Perplexity
1
OpenAI (training)
1
Resources
amazon-textract-caller — pip install amazon-textract-caller · libregistry