aws-samples / aws-samples/amazon-textract-textractor

parse an existing JSON - from textract.start_document_analysis() throws AssertionError

Open
#188 9 comments 0 reactions 1 assignee Claimed by @Belval View on GitHub
need repro
Dominant language
Jupyter Notebook
Stars
493
Forks
163
PR merge metrics
No merged PRs in 30d

Description

I am parsing an existing JSON response from the asynchronous call - **textract.start_document_analysis()** but it fails to parse it. I have a multipage pdf. I get an AssertionError -
```
from textractor.parsers import response_parser
document = response_parser.parse(textract_response)
.
.
venv/lib/python3.9/site-packages/textractor/parsers/response_parser.py", line 733, in parse_document_api_response
assert len(pages) == response["DocumentMetadata"]["Pages"]
AssertionError
```
On debugging the response_parser.py file, I found that it was able to identify just 4 pages whereas mine has 13.

Also, I tried with **textract.analyze_document** for each page in pdf, combined it - and it works perfectly.
Please help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.