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.0.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9226ec481f56946857b35aa0a9223de4c19973797dc67136b4dcd3f65c185923 |
|
MD5 | 34020cf84b22f67f7944131d4b3bdecc |
|
BLAKE2b-256 | 46a4b40bb649df9d1f50ebc914542d9660c8a0e70a0a869807a45ea1172f4567 |
Close
Hashes for amazon_textract_prettyprinter-0.0.15-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e313adc5a489a1399608c91af6c49c04b08a1c808c58c398b9a2cb2796d63d |
|
MD5 | 241470fd55b4e9b88f23019ef5904ad3 |
|
BLAKE2b-256 | ec136a67e1cdc4dc5ae4769e461098a4b729ea442a90a68f074944bc59c83acc |