Error in Python Client;
Summary
When using param 'wait_till_finished' on ParsClient, error raised
`---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/usr/local/lib/python3.8/site-packages/parsr_client/parsr_client.py in send_document(self, file_path, config_path, server, document_name, revision, wait_till_finished, refresh_period, save_request_id, silent) 148 print('>> Job done!') 149 return { --> 150 'file': file, 151 'config': config, 152 'status_code': r.status_code,
NameError: name 'file' is not defined`
Looks like there's conflation between file_path and file in that send_document( function
Steps To Reproduce Steps to reproduce the behavior:
- Install Python Client
pip install parsr-client - Send Document like
#python res = parsr.send_document( file_path="mydocument.pdf", config_path='defaultConfig.json', document_name='The Readme', refresh_period = 5, silent = False, save_request_id=True, wait_till_finished = True) - See error
Expected behavior Return of object with reference to json, xml, and other attributes
Actual behavior A error
Screenshots If applicable, add screenshots to help explain your problem.
Environment
- python=3.8.5
- docker version of parsr-client
Hello @spencerR1992,
We will look at it and come back to you when solved.
Hello @spencerR1992 ,
There are 2 errors in lines 150 and 151 of parsr_client.py
You can replace this lines by:
'file': file_path,
'config': config_path,
It should solve you problem. It will be update in the next release.
Regards
Relevant: https://github.com/axa-group/Parsr/pull/490#issuecomment-688554007
After instlling from PIP on 21.05.2021, I found this to still be an issue when running from the command line. Also, the Jupyter Notebook Demo still invokes the wrong (old) command in the first place, this should be fixed as well.
It would be nice if you published a new release to PyPI that incorporates this fix.