Coder Social home page Coder Social logo

kairon007 / zerodharequesttoken Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinaykachare/zerodharequesttoken

0.0 1.0 0.0 2 KB

Zerodha Request Token is a python script built using selenium to automate the zerodha login process in order to get the request_token which will be further used to get the access_token.

Python 100.00%

zerodharequesttoken's Introduction

ZerodhaRequestToken

Zerodha Request Token is a python script built using selenium to automate the zerodha login process in order to get the request_token which will be further used to get the access_token.

Currently you need to login manually to get request token from URL, as per exchange policy, auto-login is not allowed. Access token is valid through the day, until you log-out/destroy the session. In order to automate this process I have developed this script.

Zerodha Documentation :- https://kite.trade/docs/connect/v3/user/

Installing

You can directly install below packages using pip.

pip install selenium

pip install urllib3

Or

You can create python virtual enviornment and install dependencies using requirement.txt.

pip install -r requirement.txt

Getting Started

Set the below variables with your own values inside the GetUserSession.py file ZerodhaAccessToken class init.

    self.apiKey = 'xx_your_api_key' 
    
    self.apiSecret = 'xx_your_api_secret'
    
    self.accountUserName = 'xx_your_zerodha_userid'
    
    self.accountPassword = 'xx_your_zerodha_password'
    
    self.securityPin = 'xx_your_pin'

Download Chrome Driver (depending on your chrome version) https://chromedriver.chromium.org/downloads and set the chrome driver path variable inside the getaccesstoken function to your local machine driver path.

chrome_driver_path = "chrome_driver_path\\your_machine\\chromedriver.exe"

Usage

  _ztoken = ZerodhaAccessToken() 

  actual_token = _ztoken.getaccesstoken()

Prerequisites

  1. Python - 3.6
  2. Chrome Driver (depending on your chrome version) url - https://chromedriver.chromium.org/downloads

zerodharequesttoken's People

Contributors

vinaykachare avatar

Watchers

James Cloos avatar

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.