So, Here we can conclude the Docparser working as below:
+ Create a parser.
+ Upload document.
+ Define parsing rules over the uploaded document.
+ Get the output in the desired format.
Now, we can go through Odoo Perspective. We already know Odoo using Python language, we can use Docparser in Odoo for document analyzing. If we clear with Python as codes with Docparser, we can create some forms and settings in Odoo, then add api keys, its parser keys and analyze thousands of documents within minutes. The Python stuff is describing below:
Docparser Python api:
we can use Docparser api for:
To list Document Parsers.
To upload documents to a Document Parser with its ID.
To obtain our parsed data in the desired format.
These are described below with python code.
1) Authentication:
An authentication process is the first process with api, It can be done with our Docparser account’s secret api key. See the code below:
Python Code:
INPUT:
r = requests.get('https://api.docparser.com/v1/ping', auth=('<your Api key from docparser>', ''))
print r.json()
OUTPUT:
{u'msg': u'pong'}
2) Uploading Data:
Just give the file to a variable and upload it as below:
INPUT:
file_name ='filename.pdf'
with open(file_name) as f:
r = requests.post('https://api.docparser.com/v1/document/upload/<parser key>', files={'file':f},auth=('<your Api key from docparser>', ''))
print r.json()
output:
{u'quota_used': 59, u'quota_refill': u'1970-01-01T00:00:00+00:00', u'quota_left': 91, u'id': u'183152530562c23026a3a485e586153d', u'file_size': 33398}
in the case of a number of documents to upload, better using any handlers or signal function. Otherwise, the response will be “Document is not ready” or something else like that.
3) Get Parsed Data:
INPUT:
r = requests.get('https://api.docparser.com/v1/results/<parser id>/<file id from upload command>',auth=('<your Api key from docparser>', ''), timeout=5)
print r.json()
OUTPUT:
"page_count":1,"uploaded_at":"2017-07-29T07:38:46+00:00","processed_at":"2017-07-29T07:50:41+00:00","application_date":null,"applicant":{"first":":","last":"Nilmar Shereef"},"mail_id":{"email":"shereef@cybrosys.in"},"mark_table":[{"key_0":"Rank","key_1":"Mark","key_2":"Weightage"},{"key_0":"11","key_1":"927\/1000","key_2":"9"}],"cat":": Technical"}]
These are the basic api operations in Python for managing Docparser. So this blog concludes that Odoo can use Docparser for the document management industry, OMR analysis, feedback marking system, any other industry that processes a wide range of documents for running efficiently and automatically.
To know more about odoo integrations