Giter VIP home page Giter VIP logo

Comments (11)

ba11b0y avatar ba11b0y commented on June 8, 2024

Hello @uberdeveloper
Please make sure you have a keys.conf file in the same directory as your main python file.
The conf file should contain all the keys required for authentication.
Please refer to the docs here

from py5paisa.

ba11b0y avatar ba11b0y commented on June 8, 2024

Once you get your authentication right, all errors will be resolved.
Let me know if you face any further problems.

from py5paisa.

uberdeveloper avatar uberdeveloper commented on June 8, 2024

Hi @invinciblycool
Tried a python 3.7 virtual environment and logged in but cannot get any other method working.
client.order_book() only displays time
client.margin() shows the following error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-1b3f47e43290> in <module>
----> 1 client.margin()

~/anaconda3/lib/python3.6/site-packages/py5paisa/py5paisa.py in margin(self)
     60 
     61     def margin(self):
---> 62         return self._user_info_request("MARGIN")
     63 
     64     def order_book(self):

~/anaconda3/lib/python3.6/site-packages/py5paisa/py5paisa.py in _user_info_request(self, data_type)
     95         payload["head"]["requestCode"] = request_code
     96         response = self.session.post(url, json=payload, headers=HEADERS).json()
---> 97         message = response["body"]["Message"]
     98         if message != "Success":
     99             log_response(message)

TypeError: 'NoneType' object is not subscriptable

from py5paisa.

ba11b0y avatar ba11b0y commented on June 8, 2024

Can you update the SDK to the latest release pip install py5paisa==0.1.5

Also, it just shows you the log time because your order book is empty.

from py5paisa.

uberdeveloper avatar uberdeveloper commented on June 8, 2024

It is already at py5paisa==0.1.5

certifi==2020.6.20
chardet==3.0.4
idna==2.10
loguru==0.5.1
pbkdf2==1.3
py5paisa==0.1.5
pycryptodome==3.9.8
requests==2.24.0
urllib3==1.25.10

I placed an amo via web version and also placed order that got rejected but both of them do not show up

from py5paisa.

ba11b0y avatar ba11b0y commented on June 8, 2024

I hope you're not getting any errors?
Also, not sure if rejected orders show up.

from py5paisa.

uberdeveloper avatar uberdeveloper commented on June 8, 2024

Sure, I am not getting any errors since time gets printed.
But my expectation is all orders should show up irrespective of AMO or canceled or rejected.
Maybe, I would try this in market hours and see how this works and report back.

Thanks for the response

from py5paisa.

uberdeveloper avatar uberdeveloper commented on June 8, 2024

Also, could you change the return values to a list instead of None for the methods so that we could have a reasonable return value based on the type of output?
Should I raise a separate issue for this?

from py5paisa.

ba11b0y avatar ba11b0y commented on June 8, 2024

Also, could you change the return values to a list instead of None for the methods so that we could have a reasonable return value based on the type of output?
Should I raise a separate issue for this?

Yes, please. Raising a separate issue with more details will be better.
Also, let me know the status of this issue.

from py5paisa.

uberdeveloper avatar uberdeveloper commented on June 8, 2024

You could close this thread since the original invalid session error do not arise with Python 3.7

from py5paisa.

ba11b0y avatar ba11b0y commented on June 8, 2024

Thanks!
Feel free to open issues if any!

from py5paisa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.