{"id":13510734,"url":"https://github.com/swapniljariwala/nsepy","last_synced_at":"2025-03-30T16:34:59.767Z","repository":{"id":39674360,"uuid":"41800662","full_name":"swapniljariwala/nsepy","owner":"swapniljariwala","description":"Python Library to get publicly available data on NSE website ie. stock quotes, historical data, live indices","archived":false,"fork":false,"pushed_at":"2023-12-24T18:52:38.000Z","size":228,"stargazers_count":746,"open_issues_count":163,"forks_count":374,"subscribers_count":66,"default_branch":"master","last_synced_at":"2024-09-01T03:08:48.301Z","etag":null,"topics":["derivative","historical-data","pe-history","price-history","stock"],"latest_commit_sha":null,"homepage":"https://nsepy-xyz.web.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swapniljariwala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-09-02T12:49:21.000Z","updated_at":"2024-08-31T11:05:00.000Z","dependencies_parsed_at":"2022-07-13T12:00:57.555Z","dependency_job_id":"5187111c-ed59-45cd-b6b5-0557c65dbdc9","html_url":"https://github.com/swapniljariwala/nsepy","commit_stats":{"total_commits":210,"total_committers":13,"mean_commits":"16.153846153846153","dds":0.7333333333333334,"last_synced_commit":"75ed85c319cb1e519f1bbd8824ad398b8efca7e7"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swapniljariwala%2Fnsepy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swapniljariwala%2Fnsepy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swapniljariwala%2Fnsepy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swapniljariwala%2Fnsepy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swapniljariwala","download_url":"https://codeload.github.com/swapniljariwala/nsepy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222566739,"owners_count":17004237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["derivative","historical-data","pe-history","price-history","stock"],"created_at":"2024-08-01T02:01:52.228Z","updated_at":"2024-11-01T11:31:17.829Z","avatar_url":"https://github.com/swapniljariwala.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"# NSEpy 0.8\n\n## Deprecation notice\n\n\u003e [!CAUTION]\n\u003e Thanks a lot for your support, but I am unable to maintain this library. NSE's old website is also getting deprecated which means NSEPy will cease to work someday when NSE shuts down the old website.\n\n## What do you do next?\n\nHere are some alternatives and related libraries which are based on new NSE's website -\n\n\n### [jugaad-data](https://github.com/jugaad-py/jugaad-data)\n\nSupports both live and historical data. It is fast as NSEPy it is using threading for downloading data like NSEPy. \n\n### [NSEDownload](https://github.com/NSEDownload/NSEDownload)\n\nYou can download stock and index history only. Expected to be fast as it uses threading. \n\n### [nsepython](https://github.com/aeron7/nsepython/tree/master)\n\nCool logo, Supports live as well as historial data. I felt it to be a bit slow for historical data as it is single threaded.\n\n\n\n\nPython Library to get publicly available data on NSE website ie. stock quotes, historical data, live indices.\n\nDetailed documentation here - https://nsepy-xyz.web.app\n\nRelease Notes\n* Added support for derivative data. (Probably only API for indian derivative and India VIX data as Yahoo API has no support for derivatives)\n* Support for RBI reference rates for USD\n* Download data thru simple cli\n* Unified and simplified API for all (Equity, Index, Derivative, Volatility Indexes-INDIAVIX)\n* Compatible and Tested with Python 2.7 and 3.4\n\n## Libraries Required\n- requests\n- beautifulsoup\n- numpy \n- scipy\n- pandas\n- lxml\n\nFor Windows systems you can install Anaconda, this will cover many dependancies (You'll have to install requests and beautifulsoup additionally though)\n\n## Installation\nFresh installation \n\n```$pip install nsepy```\n\nUpgrade\n\n```$pip install nsepy --upgrade```\n\n## Usage\n\nGet the price history of stocks and NSE indices directly in pandas dataframe-\n```python\n\n#Stock history\nsbin = get_history(symbol='SBIN',\n                    start=date(2015,1,1), \n                    end=date(2015,1,10))\nsbin[[ 'VWAP', 'Turnover']].plot(secondary_y='Turnover')\n\n\"\"\"\tIndex price history\n\tsymbol can take these values (These indexes have derivatives as well)\n\t\"NIFTY\" or \"NIFTY 50\",\n\t\"BANKNIFTY\" or \"NIFTY BANK\",\n\t\"NIFTYINFRA\" or \"NIFTY INFRA\",\n    \t\"NIFTYIT\" or \"NIFTY IT\",\n    \t\"NIFTYMID50\" or \"NIFTY MIDCAP 50\",\n    \t\"NIFTYPSE\" or \"NIFTY PSE\"\n\tIn addition to these there are many indices\n\tFor full list refer- http://www.nseindia.com/products/content/equities/indices/historical_index_data.htm\n\"\"\"\nnifty = get_history(symbol=\"NIFTY\", \n                    start=date(2015,1,1), \n                    end=date(2015,1,10),\n\t\t\t\t\tindex=True)\nnifty[['Close', 'Turnover']].plot(secondary_y='Turnover')\n\n\n```\nSample contents of the one of the dataframe (I'm using Anaconda and Spyder)-\n```\nIn[6]: nifty_fut\nOut[6]: \n           Symbol      Expiry     Open    High      Low    Close     Last  \nDate                                                                        \n2015-01-01  NIFTY  2015-01-29  8320.00  8356.0  8295.20  8343.80  8347.05   \n2015-01-02  NIFTY  2015-01-29  8352.25  8470.9  8352.25  8458.40  8468.00   \n2015-01-05  NIFTY  2015-01-29  8452.35  8492.0  8406.00  8422.85  8423.85   \n2015-01-06  NIFTY  2015-01-29  8422.00  8422.0  8000.00  8157.90  8150.30   \n2015-01-07  NIFTY  2015-01-29  8150.00  8184.0  8096.00  8141.85  8154.00   \n2015-01-08  NIFTY  2015-01-29  8209.00  8274.9  8193.10  8257.25  8255.00   \n2015-01-09  NIFTY  2015-01-29  8306.35  8334.0  8205.00  8315.50  8311.60   \n\n            Settle Price  Number of Contracts      Turnover  Open Interest  \nDate                                                                         \n2015-01-01       8343.80               152053  3.165350e+10       21140550   \n2015-01-02       8458.40               384440  8.105711e+10       21427925   \n2015-01-05       8422.85               362889  7.661895e+10       20698500   \n2015-01-06       8157.90               807830  1.663583e+11       19157775   \n2015-01-07       8141.85               513814  1.046381e+11       18716025   \n2015-01-08       8257.25               409705  8.433153e+10       17798500   \n2015-01-09       8315.50               596384  1.234251e+11       17111350   \n\n            Change in OI  Underlying  \nDate                                  \n2015-01-01        -28675     8284.00  \n2015-01-02        287375     8395.45  \n2015-01-05       -729425     8378.40  \n2015-01-06      -1540725     8127.35  \n2015-01-07       -441750     8102.10  \n2015-01-08       -917525     8234.60  \n2015-01-09       -687150     8284.50  \n```\n\n\n## How can I contribute?\nThere are multiple ways in which you can contribute-\n\n### Write about your project\n\nI'm putting about 1 Hr per week on NSEpy as hobby and I will continue to do so. but as this effort is just not enough, NSEpy at the moment is short of good documentation. There are lot of features in NSEpy still not documented :( , so till we complete the documentation, I'll need support from the community.\n\nPlease write about your projects in blogs, quora answers and other forums, so that people find working examples to get started.\n\n### Raising issues, bugs, enhancement requests\n\nFor quick resolution please raise issues both [here on issue page](https://github.com/swapniljariwala/nsepy/issues) as well as on [Stackoverflow](https://stackoverflow.com/). I'll try my best to address the issues quickly on github as and when I get notified, but raising it on stackoverflow will provide you access to a larger group and someone else might solve your problem before I do.\n\n### Submit patches\n\nIf you have fixed an issue or added a new feature, please fork this repository, make your changes and submit a pull request. [Here's good article on how to do this.](https://code.tutsplus.com/tutorials/how-to-collaborate-on-github--net-34267) \n\nLooking forward for healthy participation from community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswapniljariwala%2Fnsepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswapniljariwala%2Fnsepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswapniljariwala%2Fnsepy/lists"}