Docsumo Class

Docsumo

Documo class to upload document and get extracted data

class docsumo.Docsumo.Docsumo(apikey=None, url=None, version='v1')[source]

Bases: object

Initializes an object of Docsumo class.

Args:
apiKey:str
API key provided to user.
url:str
Url of docsumo api
version:str
API version.
Returns:
Docsumo class object.
delete_documents(doc_ids)[source]

delete document Args:

doc_ids:list
list of doc_ids
Returns:

Doc_ids Detail: json

{
    'deleted_doc': [],
    'not_deleted_doc': [{'doc_id': 'ghsd',
                        'err_message': 'files doesnt exist'}, ..]
}
delete_documents_all()[source]

Delete all documents

Returns:
Deleted Doc list : list
documents_list(offset=0, limit=20, status='', created_date_greater_than='', created_date_less_than='')[source]

Returns basic details of all the documents uploaded by the user.

Args:
offset:int
Index from where to fetch the list of documents.
limit:int
Number of documents whose details are to be fetched.
status:list
The status of the documents processed new review_required review_skipped.
created_date_greater_than: str
format YYYY-MM-DD
created_date_less_than: str
format YYYY-MM-DD
Returns:

Document list with details : dict

{
    'data': {
        'documents': [{
                'doc_id': '1c37c1b0dc42416e91c7fa6a324f99a2',
                'status': 'new',
                'title': '6ca2bbf358ba4c8e9be7751b91aba3e5.pdf',
                'type': 'invoice'
            },
            {
                'doc_id': '9ec5b02a3caf423eb08e740c5696082b',
                'status': 'new',
                'title': '6ca2bbf358ba4c8e9be7751b91aba3e5.pdf',
                'type': 'invoice'
            },
            {
                'doc_id': 'f362e1fff99b4f329b5cfe79fe813cc9',
                'status': 'review_required',
                'title': 'c05440f11dda4cfba70a856114e12a50.jpg',
                'type': 'invoice'
            },
            {
                'doc_id': '5a031d2f4e224c069f9bd5016f941074',
                'status': 'review_required',
                'title': 'c05440f11dda4cfba70a856114e12a50.jpg',
                'type': 'invoice'
            },
            {
                'doc_id': '1644a07973fd4f919a298c7792469700',
                'status': 'review_required',
                'title': 'c05440f11dda4cfba70a856114e12a50.jpg',
                'type': 'invoice'
            }
        ],
        'limit': 5,
        'offset': 0,
        'total': 11
    },
    'error': '',
    'error_code': '',
    'message': '',
    'status': 'success',
    'status_code': 200
}
documents_summary()[source]

Summary of all document status

Returns:

Limit Information : dict

{
    'error': '',
    'error_code': '',
    'message': '',
    'status': 'success',
    'status_code': 200,
    'data': {
        "processed":1,
        "new":1
    }
}
extracted_data(doc_id)[source]

Returns details of a document whose valid document id is provided in doc_id agrument.

Args:
doc_id:str
Valid Document Id of the document whose detail is required.
Returns:

Document details : dict

{
    'data': {
                'Basic Information': {
                    'Invoice Number': '307538597',
                    'Issue Date': '06/16/2014',
                    'Terms': ''
                },
                'Buyer Detail': {
                    'Address': 'Ticket Buyer '
                    'Company Street 1 '
                    'Adelaide, 55555 '
                    'Australia',
                    'GST/ VAT Number': '',
                    'Name': 'Ticket Buyer Company '
                    'Name'
                },
                'GST & Amount': {
                    'Subtotal': '',
                    'Tax Rate': '15 %',
                    'Tax Total': '',
                    'Total Due': 7.04
                },
                'Line Items': [{
                        'Description': 'Item '
                        'Description',
                        'HSN': '',
                        'Quantity': 'Quantity',
                        'Subtotal Line': 'Sub-Total '
                        '(net)',
                        'Tax Rate Line': 'GST',
                        'Unit Price': 'Unit Price '
                        '(net)'
                    },
                    {
                        'Description': 'Adult Plates',
                        'HSN': '',
                        'Quantity': '',
                        'Subtotal Line': '$5.00',
                        'Tax Rate Line': '15 %',
                        'Unit Price': '$5.00'
                    },
                    {
                        'Description': '> Eventbrite '
                        'Service & '
                        'Payment Fees',
                        'HSN': '',
                        'Quantity': '',
                        'Subtotal Line': '$1.29',
                        'Tax Rate Line': '0%',
                        'Unit Price': ''
                    },
                    {
                        'Description': 'Children',
                        'HSN': '',
                        'Quantity': '',
                        'Subtotal Line': '$0.00',
                        'Tax Rate Line': '0%',
                        'Unit Price': '$0.00'
                    },
                    {
                        'Description': '> Eventbrite '
                        'Service & '
                        'Payment Fees',
                        'HSN': '',
                        'Quantity': '',
                        'Subtotal Line': '$0.00',
                        'Tax Rate Line': '0%',
                        'Unit Price': ''
                    }
                ],
                'Seller Detail': {
                    'Address': 'Adelaide, 55555 '
                    'Australia',
                    'GST/ VAT Number': '',
                    'Name': 'Organizer Company '
                    'Name'
                }
            }
    'error': '',
    'error_code': '',
    'message': '',
    'status': 'success',
    'status_code': 200
}
upload_file(file_path, doc_type)[source]

Uploads valid documents for processing.

Args:
file_path:str
Path of document to be uploaded.
doc_type:str
Document type. Currently supported: invoice, invoice_financing, bank_statements
Returns:

Document upload details for successful uploads : dict

{
    'data': {
            'created_at': 'Mon, 22 Apr 2019 11:56:53 GMT',
            'doc_id': '16474639f3da47beb87788c875503009',
            'email': 'bkrm.dahal@gmail.com',
            'status': 'new',
            'title': 'c05440f11dda4cfba70a856114e12a50.jpg',
            'type': 'invoice',
            'url_original': 'https://test.png',
            'user_id': '5cbcb201a79f0f1d983a34ea'
    },
    'error': '',
    'error_code': '',
    'message': '',
    'status': 'success',
    'status_code': 200
}
user_detail_credit_limit()[source]

Provides credit limit information for user. Provides the information on the number of documents that the user can upload and the number of documents the user has already uploaded.

Returns:

Limit Information : dict

{
    'error': '',
    'error_code': '',
    'message': '',
    'status': 'success',
    'status_code': 200,
    'data': {
        'email': 'bkrm.dahal@gmail.com',
        'full_name': 'Bikram Dahal',
        'monthly_doc_current': 10,
        'monthly_doc_limit': 300,
        'user_id': '5cbcb201a79f0f1d983a34ea'
    }
}