This does not work any more. They have changed their API's Login Schema.
Disclosure - https://forum.unofficed.com/t/unoffical-browser-based-python-api-of-5paisa/613
Unoffical Browser Based Python API of 5paisa made at Unofficed.
Its created live today morning only. https://youtube.com/watch?v=2PXSfi0Rsho
Feel Free to Tweak it, Modify it and Add the rest of the missing functions to it at your pace.
Use the package manager pip to install api5paisa.
pip install api5paisa
from api5paisa import Api5Paisa
api = Api5Paisa()
api.login("email or clientId", "passowrd", "dob in the format ddMMyyyy")
#for easy access create ~/.5paisa.conf and user api.login() refer examples/5paisa.conf
#Get Margin
print(api.get_margin())
#Get Trade Book
print(api.get_trade_book())
#Firing Order
order_response = api.order('SBIN', 170.2, 1)
print(order_response)
print(api.get_order_book())
For Documentation and Sample Code, Refer - https://forum.unofficed.com/
For Discussion and Improving this Code, Join - https://www.unofficed.com/chat/