Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Python Client; #488

Open
spencerR1992 opened this issue Aug 28, 2020 · 5 comments
Open

Error in Python Client; #488

spencerR1992 opened this issue Aug 28, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@spencerR1992
Copy link

Summary
When using param 'wait_till_finished' on ParsClient, error raised
`---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in
----> 1 res = parsr.send_document(
2 file_path="BariatricSurgery.pdf",
3 config_path='defaultConfig.json',
4 document_name='The Readme',
5 refresh_period = 5, silent = False,

/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:

  1. Install Python Client pip install parsr-client
  2. 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)
  3. 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
@spencerR1992 spencerR1992 added the bug Something isn't working label Aug 28, 2020
@dafelix42
Copy link
Contributor

Hello @spencerR1992,

We will look at it and come back to you when solved.

@dafelix42
Copy link
Contributor

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

@royjohal
Copy link
Contributor

Relevant: #490 (comment)

@AndBu
Copy link
Contributor

AndBu commented May 21, 2021

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.

@kgeis
Copy link
Contributor

kgeis commented Sep 10, 2022

It would be nice if you published a new release to PyPI that incorporates this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants