zerodha-tickersaver


Namezerodha-tickersaver JSON
Version 1.1.2 PyPI version JSON
download
home_page
SummaryGet the latest price of instruments via web-sockets from zerodha
upload_time2023-03-22 17:24:51
maintainer
docs_urlNone
author
requires_python>=3.9
license
keywords zerodha websockets ltp tick nfo options
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Zerodha WebSocket Ticker Saver  
  
<h2 align="center">  
    <a href="https://httpie.io" target="blank_">  
        <img height="100" alt="Ticker Saver" src="https://github.com/simonmh2u/TickerSaver/blob/main/docs/logo.png?raw=true" />  
    </a>  
    <br>  
 Free web-socket wrapper client for Zerodha Trading platform   
</h2>  
  
# What  
  
TickerSaver is a  web-socket wrapper client for Zerodha trading platform which can listen to the Zerodha web-socket stream for any stock or index instruments on the Trading platform and saves the current price of the instrument  in sqlite database.  
Any backend Live Trading Algo program can now use this live tick current price data by reading from the sql-lite database which is continuously getting updated by the TickerSaver application.   
**It does this all free without the 2000 INR monthly cost that Zerodha charges for WebSocket live tick data.**  
  
# Install  
  
  
# How  
  
- User needs to have a valid  account on Zerodha Trading platform - Kite  
- User will need log into the Kite Web on any browser and copy the user token and username from the browser and provide it to the TickerSaver application  
- TickerSaver will now connect to your account and connect to Zerodha WebSocket server to get live tick data for any subscribed instruments  
- It will save the current price of all subscribed instruments in a sql-lite database which can then be used by any of your applications like Live Trading bots to get the current live price from this sql-lite db which is constantly getting updated  
  
  
# Features  
- Costs 0 rupees to get live tick data  
- Saves the current price of all subscribed instruments in sql-lite database which can be used by live trading bots   
- At startup it  can subscribe  to get and save the current price of all instruments showing up in the current positions in Zerodha account based on config ```subscribe_current_positions```.   
- Can dynamically subscribe to new instruments when the application is already  running by adding the  Zerodha instrument_id , tradingsymbol in the ```conf/ticker_instruments.csv``` file  For example: ```12628226,BANKNIFTY22N0339500PE```  
- When new positions are taken in Zerodha account after application startup and if they need to be subscribed to dynamically then just create a file ```touch instrument_touch.txt``` which will load all current positions from Zerodha account and subscribe to them and start saving the current price .  
  
# Usage  
### Installation  
- Install the package 
	 ``` pip install zerodha_tickersaver```  

OR

- Download the source
```git clone https://github.com/simonmh2u/TickerSaver.git```

  
### Config file  
-  Takes as an input a json config file
- dbpath :  absolute path of the sqlite file where it needs to be created
- tickerfile_path: absolute path of the csv file which stores the instrument file that are subscribed by the application
- subscribe_current_positions : If true reads the current positions in the users zerodha account and subscribes to those instruments to get the current price
- default_instruments: list of zerodha instruments that will get subscribed to by default even if not present in the tickerfile csv
- zusername: userid copied from browser
- zwsstoken: token copied from the browser
```  
{    
  "dbpath": "/Users/johnwick/ticker_instruments.csv/live_price.db",    
  "tickerfile_path": "/Users/johnwick/ticker_instruments.csv",    
  "subscribe_current_positions": true,    
  "default_instruments": [    
   256265,    
   264969,    
   260105    
   ],
  "zusername":"",
  "zwsstoken":""
 }  
```  
  
### Startup Steps  
- User needs to manually login into Kite on any browser , and copy the below token and user from the Cookie section of the developer console.  

    <a href="https://httpie.io" target="blank_">  
        <img height="100" alt="Ticker Saver" src="https://github.com/simonmh2u/TickerSaver/blob/main/docs/cookie.png?raw=true" />  
    </a>  
    <br>  
  
- Needs to set the username and token as environment variables "ZUSERNAME"  and "ZWSSTOKEN" respectively    
- Needs to add  "zusername" and "zwsstoken" configs in the user supplied config file path(this overrides the above env variables)  
   ``` { "zusername":"YL1111", "zwsstoken":"XXXXXXX" } ```
- Fire up the application

    - ```tickersaver -c config.json``` (when package installed)

    - ``` python tickersaver/fetcher/kite/ws_tick_fetcher.py  -c config.json``` (when source downloaded)


# Disclaimer  
TickerSaver is an application built for self learning and as a  Jugaad *(definition: a resourceful approach to problem-solving)* to understand the working of web-sockets and to see if the live tick data from zerodha can be extracted and saved locally tick by tick for free without paying for monthly charges for API access. Please use at your own discretion.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "zerodha-tickersaver",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "zerodha,websockets,ltp,tick,nfo,options",
    "author": "",
    "author_email": "Simon <simonmh2u@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d5/d2/3cae154794ced87db42e590d59ffe15190f5d0762c2a0c618c2295a2222f/zerodha_tickersaver-1.1.2.tar.gz",
    "platform": null,
    "description": "\n# Zerodha WebSocket Ticker Saver  \n  \n<h2 align=\"center\">  \n    <a href=\"https://httpie.io\" target=\"blank_\">  \n        <img height=\"100\" alt=\"Ticker Saver\" src=\"https://github.com/simonmh2u/TickerSaver/blob/main/docs/logo.png?raw=true\" />  \n    </a>  \n    <br>  \n Free web-socket wrapper client for Zerodha Trading platform   \n</h2>  \n  \n# What  \n  \nTickerSaver is a  web-socket wrapper client for Zerodha trading platform which can listen to the Zerodha web-socket stream for any stock or index instruments on the Trading platform and saves the current price of the instrument  in sqlite database.  \nAny backend Live Trading Algo program can now use this live tick current price data by reading from the sql-lite database which is continuously getting updated by the TickerSaver application.   \n**It does this all free without the 2000 INR monthly cost that Zerodha charges for WebSocket live tick data.**  \n  \n# Install  \n  \n  \n# How  \n  \n- User needs to have a valid  account on Zerodha Trading platform - Kite  \n- User will need log into the Kite Web on any browser and copy the user token and username from the browser and provide it to the TickerSaver application  \n- TickerSaver will now connect to your account and connect to Zerodha WebSocket server to get live tick data for any subscribed instruments  \n- It will save the current price of all subscribed instruments in a sql-lite database which can then be used by any of your applications like Live Trading bots to get the current live price from this sql-lite db which is constantly getting updated  \n  \n  \n# Features  \n- Costs 0 rupees to get live tick data  \n- Saves the current price of all subscribed instruments in sql-lite database which can be used by live trading bots   \n- At startup it  can subscribe  to get and save the current price of all instruments showing up in the current positions in Zerodha account based on config ```subscribe_current_positions```.   \n- Can dynamically subscribe to new instruments when the application is already  running by adding the  Zerodha instrument_id , tradingsymbol in the ```conf/ticker_instruments.csv``` file  For example: ```12628226,BANKNIFTY22N0339500PE```  \n- When new positions are taken in Zerodha account after application startup and if they need to be subscribed to dynamically then just create a file ```touch instrument_touch.txt``` which will load all current positions from Zerodha account and subscribe to them and start saving the current price .  \n  \n# Usage  \n### Installation  \n- Install the package \n\t ``` pip install zerodha_tickersaver```  \n\nOR\n\n- Download the source\n```git clone https://github.com/simonmh2u/TickerSaver.git```\n\n  \n### Config file  \n-  Takes as an input a json config file\n- dbpath :  absolute path of the sqlite file where it needs to be created\n- tickerfile_path: absolute path of the csv file which stores the instrument file that are subscribed by the application\n- subscribe_current_positions : If true reads the current positions in the users zerodha account and subscribes to those instruments to get the current price\n- default_instruments: list of zerodha instruments that will get subscribed to by default even if not present in the tickerfile csv\n- zusername: userid copied from browser\n- zwsstoken: token copied from the browser\n```  \n{    \n  \"dbpath\": \"/Users/johnwick/ticker_instruments.csv/live_price.db\",    \n  \"tickerfile_path\": \"/Users/johnwick/ticker_instruments.csv\",    \n  \"subscribe_current_positions\": true,    \n  \"default_instruments\": [    \n   256265,    \n   264969,    \n   260105    \n   ],\n  \"zusername\":\"\",\n  \"zwsstoken\":\"\"\n }  \n```  \n  \n### Startup Steps  \n- User needs to manually login into Kite on any browser , and copy the below token and user from the Cookie section of the developer console.  \n\n    <a href=\"https://httpie.io\" target=\"blank_\">  \n        <img height=\"100\" alt=\"Ticker Saver\" src=\"https://github.com/simonmh2u/TickerSaver/blob/main/docs/cookie.png?raw=true\" />  \n    </a>  \n    <br>  \n  \n- Needs to set the username and token as environment variables \"ZUSERNAME\"  and \"ZWSSTOKEN\" respectively    \n- Needs to add  \"zusername\" and \"zwsstoken\" configs in the user supplied config file path(this overrides the above env variables)  \n   ``` { \"zusername\":\"YL1111\", \"zwsstoken\":\"XXXXXXX\" } ```\n- Fire up the application\n\n    - ```tickersaver -c config.json``` (when package installed)\n\n    - ``` python tickersaver/fetcher/kite/ws_tick_fetcher.py  -c config.json``` (when source downloaded)\n\n\n# Disclaimer  \nTickerSaver is an application built for self learning and as a  Jugaad *(definition: a resourceful approach to problem-solving)* to understand the working of web-sockets and to see if the live tick data from zerodha can be extracted and saved locally tick by tick for free without paying for monthly charges for API access. Please use at your own discretion.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Get the latest price of instruments via web-sockets from zerodha",
    "version": "1.1.2",
    "split_keywords": [
        "zerodha",
        "websockets",
        "ltp",
        "tick",
        "nfo",
        "options"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eed4aca09a4da1c720ab04f428bf31aeb2c586cf7c33c2499cd76f0395276373",
                "md5": "c0ed520d8032dc027920e0198872523b",
                "sha256": "ac792533d51c79b3219563a8e01b70633ea78ea3a7068562172acb756d767b70"
            },
            "downloads": -1,
            "filename": "zerodha_tickersaver-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0ed520d8032dc027920e0198872523b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9843,
            "upload_time": "2023-03-22T17:24:49",
            "upload_time_iso_8601": "2023-03-22T17:24:49.533828Z",
            "url": "https://files.pythonhosted.org/packages/ee/d4/aca09a4da1c720ab04f428bf31aeb2c586cf7c33c2499cd76f0395276373/zerodha_tickersaver-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5d23cae154794ced87db42e590d59ffe15190f5d0762c2a0c618c2295a2222f",
                "md5": "b73bce3e302accff97266b9ffe11473c",
                "sha256": "78a1f50bf95c54e50e481ff28c219e63c02e71948d88e39b8118d1c7b5b0481f"
            },
            "downloads": -1,
            "filename": "zerodha_tickersaver-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b73bce3e302accff97266b9ffe11473c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10439,
            "upload_time": "2023-03-22T17:24:51",
            "upload_time_iso_8601": "2023-03-22T17:24:51.303017Z",
            "url": "https://files.pythonhosted.org/packages/d5/d2/3cae154794ced87db42e590d59ffe15190f5d0762c2a0c618c2295a2222f/zerodha_tickersaver-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-22 17:24:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "zerodha-tickersaver"
}
        
Elapsed time: 0.14051s