Comments (11)
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.
Once you get your authentication right, all errors will be resolved.
Let me know if you face any further problems.
from py5paisa.
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.
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.
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.
I hope you're not getting any errors?
Also, not sure if rejected orders show up.
from py5paisa.
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.
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.
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.
You could close this thread since the original invalid session error do not arise with Python 3.7
from py5paisa.
Thanks!
Feel free to open issues if any!
from py5paisa.
Related Issues (20)
- Live feed is not working
- Unable to establish web socket connection for market feed HOT 2
- Automatic authentication HOT 5
- Couldn't read data anymore from the API's
- not able to install liberary on google collab
- not able to install the py5paisa on google collab and AWS sagemaker
- Error while installing latest version using pip HOT 1
- Invalid syntax and deprecated readme
- RemoteOrderID is not being used while placing order on MCX
- Inconsistent behaviour between Tradestation website and API - Cash Orders on NSE generate errors like 'Scrip Not Available for Trading" - but can place order for same scrip on Tradestation website
- Incorrect response for Futures data
- Major Bug: self.payload not being reset
- Lack of Clear API Responses for User Actions
- get_expiry api not working for BANKNIFTY HOT 1
- Websocket shortcomings
- VTT Order placed successfully but not executed at condition.
- 'FivePaisaClient' object has no attribute 'WEBSOCKET_URL' HOT 2
- Server Response Time Issue with Scrip Master Contract Download HOT 1
- live streamming is not working HOT 1
- client.get_totp_session returns error `Expecting value: line 1 column 1 (char 0)`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py5paisa.