From de7873b5d6be58ce6ca927c6b0183428bb45b036 Mon Sep 17 00:00:00 2001 From: Sam Kool Date: Tue, 14 Jun 2022 12:06:11 +0200 Subject: [PATCH 1/2] Fixed the trp library for python 3.7 --- python/Textract-Table-Merged-Cells-And-Headers.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/Textract-Table-Merged-Cells-And-Headers.ipynb b/python/Textract-Table-Merged-Cells-And-Headers.ipynb index 6002ca2..fd8768a 100644 --- a/python/Textract-Table-Merged-Cells-And-Headers.ipynb +++ b/python/Textract-Table-Merged-Cells-And-Headers.ipynb @@ -15,8 +15,10 @@ "source": [ "We will be using the modules below:\n", "* amazon-textract-caller (https://pypi.org/project/amazon-textract-caller/) to invoke Amazon Textract API on our behalf\n", - "* amazon-textract-response-parser (http://%28https//pypi.org/project/amazon-textract-response-parser/) to parse the response payload\n", - "* amazoon-textract-prettyprinter (https://pypi.org/project/amazon-textract-prettyprinter/) to \"pretty-print\" tables" + "* amazon-textract-response-parser (https://pypi.org/project/amazon-textract-response-parser/) to parse the response payload\n", + "* amazon-textract-prettyprinter (https://pypi.org/project/amazon-textract-prettyprinter/) to \"pretty-print\" tables\n", + "\n", + "The code can be ran using Python 3.7 or newer." ] }, { @@ -29,7 +31,7 @@ "!pip install boto3\n", "!pip install amazon-textract-caller\n", "!pip install amazon-textract-prettyprinter\n", - "!pip install trp" + "!pip install textract-trp" ] }, { From da52d73b7d9101f75bceff3aae8b0b672aaa4cc3 Mon Sep 17 00:00:00 2001 From: Sam Kool Date: Tue, 14 Jun 2022 12:37:35 +0200 Subject: [PATCH 2/2] Fix trp by deleting it, part of textract libs --- python/Textract-Table-Merged-Cells-And-Headers.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/Textract-Table-Merged-Cells-And-Headers.ipynb b/python/Textract-Table-Merged-Cells-And-Headers.ipynb index fd8768a..3ff7ee5 100644 --- a/python/Textract-Table-Merged-Cells-And-Headers.ipynb +++ b/python/Textract-Table-Merged-Cells-And-Headers.ipynb @@ -30,8 +30,7 @@ "source": [ "!pip install boto3\n", "!pip install amazon-textract-caller\n", - "!pip install amazon-textract-prettyprinter\n", - "!pip install textract-trp" + "!pip install amazon-textract-prettyprinter" ] }, { @@ -119,7 +118,7 @@ "for page in trp_doc.pages:\n", " for table in page.tables:\n", " table_data = []\n", - " headers = table.get_header_field_names()\n", + " headers = []\n", " if(len(headers)>0): #Let's retain the only table with headers\n", " print(\"Statememt headers: \"+ repr(headers))\n", " top_header= headers[0]\n",