Amazon Textract Helper tools for pretty printing
Project description
Textract-PrettyPrinter
Provides functions to format the output received from Textract in more easily consumable formats incl. CSV or Markdown. amazon-textract-prettyprinter
Install
> python -m pip install amazon-textract-prettyprinter
Make sure your environment is setup with AWS credentials through configuration files or environment variables or an attached role. (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
Samples
Get FORMS and TABLES as CSV
from textractcaller.t_call import call_textract, Textract_Features
from textractprettyprinter.t_pretty_print import Pretty_Print_Table_Format, Textract_Pretty_Print, get_string
textract_json = call_textract(input_document=input_document, features=[Textract_Features.FORMS, Textract_Features.TABLES])
print(get_string(textract_json=textract_json,
table_format=Pretty_Print_Table_Format.csv,
output_type=[Textract_Pretty_Print.TABLES, Textract_Pretty_Print.FORMS]))
Get string for TABLES using the get_string method
from textractcaller.t_call import call_textract, Textract_Features
from textractprettyprinter.t_pretty_print import Textract_Pretty_Print, get_string
textract_json = call_textract(input_document=input_document, features=[Textract_Features.TABLES])
get_string(textract_json=textract_json, output_type=Textract_Pretty_Print.TABLES)
Print out tables in LaTeX format
from textractcaller.t_call import call_textract, Textract_Features
from textractprettyprinter.t_pretty_print import Textract_Pretty_Print, get_string
textract_json = call_textract(input_document=input_document, features=[Textract_Features.FORMS, Textract_Features.TABLES])
get_tables_string(textract_json=textract_json, table_format=Pretty_Print_Table_Format.latex)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for amazon-textract-prettyprinter-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aab9006177f87668f28913628a5bda4d3d07fbc8f905f2de2a621c089306de86 |
|
MD5 | b22c1b11839e71bd35ef813e4e97652d |
|
BLAKE2b-256 | 625c944b880e84a921b4be79cf10821b1916f6fea556a392c0f148f8ab13dd63 |
Close
Hashes for amazon_textract_prettyprinter-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e1067133be66e16324f3a307e7af8055ea6665aeaacbd2eb8a425ea9f8f312 |
|
MD5 | 7f336e9cba0ccebe4cbbc7df71ed0748 |
|
BLAKE2b-256 | ef6012b4321cc36f4308ff7154b12066a47fed09bf6f4676aa65b0721617819f |