Giter Club home page Giter Club logo

savekiteenctoken's Introduction

SaveKiteEnctoken

The Script Save KiteEnctoken to jsonbin.io, which can be used to synchronized Kite Enctoken between your local pc/laptop browser and Algo Trading Code at Remote Servers.

To set it up for the first time, you need to follow these steps. (Once all the steps completed, from next login onwards it will work automatically)

Browser Setup
  1. Go to https://jsonbin.io/login ans signup wth your gmail/github/facebook/twitter account. image
  2. Now Click on Create New image
  3. Now Type {"enctoken":"abcdefghijklmnopqrstuvwxyz"} in the text box and click create. image
  4. Now Click on the Profile Picture, Then Click on Dashboard image
  5. Now Copy the 24 Charachter long BIN_ID and save it on a notepad as BIN_ID = <PASTE 24 Charachter BIN_ID HERE> (For Example in this case it shall be BIN_ID = 6129d9bd2aa800361271257f) image
  6. Now Click on the VIEW MASTER KEY image
  7. And Copy the 60 Character long Master Key by clicking on COPY KEY and save it on a notepad as YOUR_API_KEY = <PASTE 60 Charachter Master Key HERE> (For Example in this case it shall be YOUR_API_KEY = $2b$10$IIWfEN3l97/jWpsxjBli0eUQopUdqzt0Ksx9dl87xGINSKxCesLte) image
  8. Now You may close the jsonbin.io website and open https://www.tampermonkey.net/ and download for chrome/firefox/edge/safari (whatever you use, In my case i will download for chrome) image image
  9. Once TamperMonkey has been added to chrome click the extension button and find tampermonkey and click on pin so it should be visible image image
  10. Now open SaveKiteEnctoken.user.js and click Install when prompted image
  11. Now Open https://kite.zerodha.com/ and you will see the TamperMonkey Icon has a red notification with 1 written on it. image
  12. Click on It, and then click on the setting below SaveKiteEnctoken image
  13. Now Fill the Your Api Key with the MASTER KEY Saved in Point No. 7 and Bin id with the BIN ID saved in Point No.5 and then click on save. image
  14. Now Login to kite as usual, and the enctoken will automatically be updated.
Python Program Modification for obtaining enctoken automatically.
###############################################################################
import requests

def get_enctoken(YOUR_API_KEY, BIN_ID):
    enctoken_url = "https://api.jsonbin.io/v3/b/"+BIN_ID+"/latest"
    headers = {
        'X-Master-Key': YOUR_API_KEY
    }
    req = requests.get(enctoken_url, json=None, headers=headers)
    enctoken = req.json()['record']['enctoken']
    return enctoken

YOUR_API_KEY = <PASTE 60 Charachter Master Key HERE from Point No.7>
BIN_ID = <PASTE 24 Charachter BIN_ID HERE from point No. 5>
enctoken = get_enctoken(YOUR_API_KEY, BIN_ID)

#################################################################################
  # For Example in our case it will be
  # YOUR_API_KEY = "$2b$10$IIWfEN3l97/jWpsxjBli0eUQopUdqzt0Ksx9dl87xGINSKxCesLte"
  # BIN_ID = "6129d9bd2aa800361271257f"
  # enctoken = get_enctoken(YOUR_API_KEY, BIN_ID)
#################################################################################
  1. Hence, For Example if you want to run your code from colab just do like this and it wont log you out of your browser session. (and when your browser session expires and you relogin, the enctoken will automatically be updated and your algo code will work as intended without interruption) image

Disclaimer: I have made this tool for my personal use and it may have bugs.

savekiteenctoken's People

Contributors

shabbirhasan1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

savekiteenctoken's Issues

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.