skillfed

amazon-textract-response-parser

Easily parse JSON returned by Amazon Textract.

amazon-textract-response-parser v1.0.3 2.1M downloads/30d#3,327 on PyPI236
Permissive license Apache License Version 2.0 DORMANT released

What it is and what it does

This package deserializes and serializes Amazon Textract OCR JSON responses into strongly-typed Python objects using marshmallow schemas. It provides two main layers: a serializer/deserializer for converting raw Textract JSON into TDocument objects, and a pipeline module with reusable components that modify or enrich the response structure—such as reordering blocks by page geometry, calculating page orientation in degrees, merging or linking multi-page tables, and adding OCR confidence scores to key-value pairs.

The library is designed to integrate into existing Textract workflows without requiring major refactoring. It supports both standard Textract responses and AnalyzeId responses, and includes a command-line tool for testing pipeline components. Runtime dependencies are boto3 (for AWS SDK integration) and marshmallow (for schema validation and serialization).

Use it for:

  • Deserialize Textract JSON into typed Python objects for downstream document processing or analysis pipelines.
  • Reorder OCR blocks by vertical position to reconstruct natural reading order when Textract returns unordered results.
  • Detect and correct page rotation by calculating orientation degrees from word and line geometry.
  • Merge or link tables that span multiple pages while preserving or enriching geometric accuracy.
  • Extract OCR confidence scores for key-value pairs to validate form field extraction quality.
  • Build batch processing workflows that transform raw Textract responses into standardized document representations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses JSON responses from Amazon Textract OCR service into typed Python objects, with pipeline components for ordering blocks, detecting page orientation, merging tables, and enriching confidence scores.

Yes, if you are actively using Amazon Textract and need structured Python objects to work with its JSON responses. The low install friction and permissive license make it a practical choice. However, dormant maintenance (no release since 2024-06-13) means you should verify that pipeline components and schema support match your Textract API version before relying on it for production workflows.

Install

amazon-textract-response-parser on PyPI

pip

pip install amazon-textract-response-parser

uv

uv add amazon-textract-response-parser

poetry

poetry add amazon-textract-response-parser

Installing amazon-textract-response-parser

Before you install

Low friction install with two stable runtime dependencies (boto3, marshmallow). Maintenance is dormant—last commit was 2024-11-19 but no release since 2024-06-13, so expect no active bug fixes or feature updates.

License in practice

Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions; suitable for most projects.

Quickstart

from amazon_textract_response_parser.trp2 import TDocument, TDocumentSchema

# j is a dict from Textract API response
t_doc = TDocumentSchema().load(j)

# Access parsed document structure
for page in t_doc.pages:
    for block in page.blocks:
        print(block.text)

Requires an active Amazon Textract API call or pre-existing Textract JSON response dict; boto3 must be configured with AWS credentials.

Verify before relying

  • Whether pipeline components (order_blocks_by_geo, add_page_orientation, merge_tables, add_kv_ocr_confidence) are production-ready or experimental.
  • Performance characteristics when processing large or multi-page documents.
  • Compatibility with recent Textract API changes or new response schema versions.

Package facts

License Apache License Version 2.0 (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — boto3, marshmallow
Maintenance dormant — 792 days since the last release
Last repo commit
First released
Downloads 2,065,985/month — #3,327 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: amazon_textract_response_parser-1.0.3-py2.py3-none-any.whl

Keywords: amazon-textract-response-parser, trp, aws, amazon, textract, ocr, response, parser

Development Status :: 4 - BetaLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Utilities

Tags

textract response parserparse textract jsonamazon textract ocrtextract document processingocr response parsingtextract json to objectstextract pipeline components
aws-textractocr-parsingdocument-processing

More Utilities packages