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

Jugaad_data stopped working #85

Open
akrajarajan opened this issue Oct 17, 2024 · 1 comment
Open

Jugaad_data stopped working #85

akrajarajan opened this issue Oct 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@akrajarajan
Copy link

Issue description

I have been using the following program for getting data from NSE. It was working well till two days ago but suddenly stopped working with the following error message. Please help (- I have added the complete program as attachment. This program reads set of realtime price values once everytime the button is pressed)

GetDataFromNSE.txt

Example Code

from jugaad_data.nse import NSELive
  
n = NSELive()
    
nifty_data = n.stock_quote("SBIN")
C = nifty_data['priceInfo']['lastPrice']
P = nifty_data['priceInfo']['pChange']

print(C,P)

Error snippet

Traceback (most recent call last):
  File "C:\Program Files\Python311\Lib\site-packages\requests\models.py", line 974, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python311\Lib\json\decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 2 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:/AKR/NonScience/INVEST/AUTO/SubmittedJugaad_GITHUB.py", line 5, in <module>
    nifty_data = n.stock_quote("SBIN")
  File "C:\Program Files\Python311\Lib\site-packages\jugaad_data\util.py", line 172, in wrapper
    value = app_name(self, *args, **kwargs)
  File "C:\Program Files\Python311\Lib\site-packages\jugaad_data\nse\live.py", line 56, in stock_quote
    return self.get("stock_quote", data)
  File "C:\Program Files\Python311\Lib\site-packages\jugaad_data\nse\live.py", line 51, in get
    return r.json()
  File "C:\Program Files\Python311\Lib\site-packages\requests\models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 2 (char 1)
@akrajarajan akrajarajan added the bug Something isn't working label Oct 17, 2024
@mriddyagrawal
Copy link

Is there any update on this bug? I also need help about it.

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

2 participants