Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amazon-textract-prettyprinter-0.0.16.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amazon_textract_prettyprinter-0.0.16-py2.py3-none-any.whl (11.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file amazon-textract-prettyprinter-0.0.16.tar.gz.

File metadata

  • Download URL: amazon-textract-prettyprinter-0.0.16.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for amazon-textract-prettyprinter-0.0.16.tar.gz
Algorithm Hash digest
SHA256 822e51844aace283e03a8823599df1f543cf7226fad9743f0664c31447cd463e
MD5 e30c3f7b1e7acdcb0b9ba6e352f21f48
BLAKE2b-256 dc5e5f07c82203679d64cf5a10fcb58ef68235ac29d360bd6de5b072ecc41262

See more details on using hashes here.

File details

Details for the file amazon_textract_prettyprinter-0.0.16-py2.py3-none-any.whl.

File metadata

  • Download URL: amazon_textract_prettyprinter-0.0.16-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for amazon_textract_prettyprinter-0.0.16-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2751d2546a2c55e2f36ca4dcfdd14f09cf2267089b8e3a08d07aa917d0e903e5
MD5 8dceecf7cb15db5ee1202c955571fc70
BLAKE2b-256 e838cd47b5ebc0ce0d051b6bb870c9a830a027dd966b0910131e239cf3c715f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page