Skip to content

akbarboghani/equities-data-utils

 
 

Repository files navigation

This is a work in progress. A few notes about how all the utils fit together

nse_utils.py and bse_utils.py - provide NSE and BSE specific functionality
nse_utils provides following API - nse_get_all_stocks_list - Returns a generator of all stocks
- nse_get_name_change_tuples - Returns a tuple of name changes - ScripInfoOHLCVD - A named tuple containing the OHLCVD data for a day - ScripBaseinfoNSE - A named tuple for info about scrip on NSE

bse_utils provides following API - bse_get_all_stocks_list - Returns a generator of all stocks - ScripBaseinfoBSE - A named tuple for info about a scrip on BSE

get_stock_nse and get_stocks_nse2 are used to download OHLCVD historical data for a stock. (get_stock_nse2 - uses bhavcopy, get_stocks_nse is observed to be a bit unreliable, hence the second approach is preferred.

get_stocks_bse is used to download OHLCVD historical data for BSE scrips.

This downloaded data is kind of a staging data. Most of this data is maintained inside an SQLite3 DB. (So someone can directly go and use it).

corp_actions_nse and corp_actions_bse are used to get corp actions for an NSE or a BSE stock. NSE version is always preferred. BSE version is incomplete yet as there are a number of issues with that (eg. ex_date is missing in many cases, stocks split ratio is missing.) To really fill this data we'd do it manually later.

get_indices_bse and get_indices_nse are used to get indices historical data from 1-Jan-2002 or whichever is earlier. These two scrips need a bit more work.

all_stocks_list.py - is a script that generates 'master list' of all stocks traded on either NSE or BSE. We do not take stocks from all 'groups' in BSE we only take group A, B and T (D and DT - we may but they are not very liquid and hence not very useful).

utils.py - contains utilities that may not be NSE or BSE specific.

Most of this data is stored in HDF5 files for high performance using Pandas.

The structure of HDF file is being iterated, so it's really very very early right now to discuss in details.

About

Utils for downloading Equities data from NSE and BSE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%