PDF Extraction

Notice – All publicly available Indico APIs will be deprecated on Jan 1, 2020

pdf_extraction(data, [api_key], [single_column], [text], [raw_text], [tables], [metadata])

Arguments

data – String | List – required – PDF filename or list of filenames to be analyzed
[api_key] – String – optional – your indico API key
[single_column] – Boolean (defaults to False) – optional – when True, assumes the input is a single column of text.
[text] – Boolean (defaults to False) – optional – when True, returns body text as part of the results for each page.
[raw_text] – Boolean (defaults to False) – optional – when True, returns all body text for the PDF document in a single block. This text matches what you would see in Indico Teach.
[metadata] – Boolean (defaults to False) – optional – when True, returns the following: tagged, form, producer, author, encryption status, program used to create the file, file size, PDF version, optimised, modification date, title, creation date, number of pages, page size
[tables] – Boolean (defaults to False) – optional – when True, returns the contents of tables in the document, separately from body text

Output

PDF Extraction returns the extracted information in JSON format so you can easily transfer the data to Custom Collections for training your own machine learning models, or for analysis using our pre-trained models. If you need someone to label the data, you can reformat the data and save as a CSV for use with Indico Teach.

{
    "pages": [
        {
            "page_num": 0,
            "tables": [],
            "text": "COHEN \nRUTHERFORD \n+ KNIGHTpc \nCertified Public Accountants \n+ + + \n++ ++ ++ \nAudited Consolidated Financial \nStatements and Other Financial \nInformation \nDoctors Community Hospital \nand Subsidiaries \nJune 30, 2013 and 2012 "
        },
        {
            "page_num": 1,
            "tables": [
                {
                    "cells": [
                        {
                            "first_col": "0",
                            "first_row": "0",
                            "last_col": "0",
                            "last_row": "0",
                            "text": "\nReport of Independent Auditors\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "0",
                            "last_col": "1",
                            "last_row": "0",
                            "text": "\n1-2 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "1",
                            "last_col": "0",
                            "last_row": "1",
                            "text": "\nConsolidated Balance Sheets\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "1",
                            "last_col": "1",
                            "last_row": "1",
                            "text": "\n3-4 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "2",
                            "last_col": "0",
                            "last_row": "2",
                            "text": "\nConsolidated Statements of Operations and Other Changes in Unrestricted Net Assets\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "2",
                            "last_col": "1",
                            "last_row": "2",
                            "text": "\n5 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "3",
                            "last_col": "0",
                            "last_row": "3",
                            "text": "\nConsolidated Statements of Changes in Net Assets\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "3",
                            "last_col": "1",
                            "last_row": "3",
                            "text": "\n6 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "4",
                            "last_col": "0",
                            "last_row": "4",
                            "text": "\nConsolidated Statements of Cash Flows\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "4",
                            "last_col": "1",
                            "last_row": "4",
                            "text": "\n7-8 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "5",
                            "last_col": "0",
                            "last_row": "5",
                            "text": "\nNotes to the Consolidated Financial Statements\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "5",
                            "last_col": "1",
                            "last_row": "5",
                            "text": "\n9-37 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "6",
                            "last_col": "0",
                            "last_row": "6",
                            "text": "\nReport of Independent Auditors on Other Financial Information\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "6",
                            "last_col": "1",
                            "last_row": "6",
                            "text": "\n38 "
                        },
                        {
                            "first_col": "0",
                            "first_row": "7",
                            "last_col": "0",
                            "last_row": "7",
                            "text": "\nConsolidating Balance Sheet and Statement of Operations Information\t "
                        },
                        {
                            "first_col": "1",
                            "first_row": "7",
                            "last_col": "1",
                            "last_row": "7",
                            "text": "\n39-41 "
                        }
                    ],
                    "n_cols": 2,
                    "n_rows": 8
                }
            ],
            "text": "\u2014 Contents \u2014 "
        },
        {
            "page_num": 2,
            "tables": [],
            "text": "COHEN \nRUTHERFORD \nKNIGHTF \nCercified Public Accountants \nReport of Independent Auditors \nBoard of Directors \nDoctors Community Hospital and Subsidiaries \nLanham, Maryland \nWe have audited the accompanying consolidated financial statements of Doctors Community \nHospital and Subsidiaries, (the Hospital) which comprise the consolidated balance sheets as of June \n30, 2013 and 2012, and the related consolidated statements of operations and other changes in \nunrestricted net assets, changes in net assets, and cash flows for the years then ended and the related \nnotes to the consolidated financial statements. \nManagement's Raponsibili0 for the Financial Statements \nManagement is responsible for the preparation and fair presentation of these consolidated financial \nstatements in accordance with accounting principles generally accepted in the United States of \nAmerica; this includes the design, implementation, and maintenance of internal control relevant to \nthe preparation and fair presentation of consolidated financial statements that are free from material \nmisstatement, whether due to fraud or error. \nAuditors' Responsibility \nOur responsibility is to express an opinion on these consolidated financial statements based on our \naudits. We conducted our audits in accordance with auditing standards generally accepted in the \nUnited States of America. Those standards require that we plan and perform the audit to obtain \nreasonable assurance about whether the consolidated financial statements are free of material \nmisstatement. \nAn audit involves performing procedures to obtain audit evidence about the amounts and \ndisclosures in the consolidated financial statements. The procedures selected depend on the \nauditor's judgment, including the assessment of the risks of material misstatement of the \nconsolidated financial statements, whether due to fraud or error. In making those risk assessments, \nthe auditor considers internal control relevant to the entity's preparation and fair presentation of the \nconsolidated financial statements in order to design audit procedures that are appropriate in the \ncircumstances, but not for the purpose of expressing an opinion on the effectiveness of the entity's \ninternal control. Accordingly, we express no such opinion. An audit also includes evaluating the \nappropriateness of accounting policies used and the reasonableness of significant accounting \nestimates made by management, as well as evaluating the overall presentation of the consolidated \nfinancial statements. \n6903 Rockledge Drive, Suite 500, Bethesda, MD 20817 Tel: 301.828.1000 Fax: 301.530.3625 "
        },

Example

import indicoio
indicoio.config.api_key = 'YOUR_API_KEY'

# single example
indicoio.pdf_extraction("filename")

# batch example
indicoio.pdf_extraction([
    "filename",
    "filename2"
])