Beruflich Dokumente
Kultur Dokumente
bluechipcode / fetchbhavcopy
Dismiss
Join GitHub today
GitHub is home to over 40 million developers working together to host and
review code, manage projects, and build software together.
Sign up
svtesan Update help text Latest commit f8a08e5 on Jul 13, 2017
README.md
fetchbhavcopy
https://github.com/bluechipcode/fetchbhavcopy 1/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
Fetches EOD files from NSE/BSE bhavcopy and dumps the files locally. The script is built to enable download history and
keep the EOD dump updated. First run will fetch the entire history till date and the subsequent ones will update whatever is
missing. At every run all missing files till date will be downloaded and the dump will be updated with latest files as of run
date.
As long as you pass the same dump dir to every invocation (there is a default, which you can choose to override) the script
will update the dump with missing files and not redownload existing files.
Has a basic holiday calendar - weekends and well known Indian public holidays (Independence day, Gandhi Jayanthi etc
whose dates dont change)
Can recognize any missing files by adding the 404'd files to not_found list so as to not fetch them again when run next
time
Can retry timed out files
Can recognize unzipped files - so you can unzip the bhavcopy in place and use them. The script will recognize them and
not refetch
Stores missing, retry files under not_found.txt, retry.txt files in each folder so you can manually choose to edit
Just delete the not found, retry files to prod the script to try download the not found scripts again - not needed
generally
Files fetched:
| | | url |
https://www.nseindia.com/content/historical/DERIVATIVES/2017/MAY/fo18MAY2017bhav.csv.zip
| | | freq | day
| | | sdt | 12 Jun 2000
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | eod_mto | eg | https://www.nseindia.com/archives/equities/mto/MTO_01012002.DAT
| | | url | https://www.nseindia.com/archives/equities/mto/MTO_18052017.DAT
| | | freq | day
| | | sdt | 01 Jan 2002
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | eod_shortsell | eg | https://www.nseindia.com/archives/equities/shortSelling/shortselling_17072012.csv
| | | url | https://www.nseindia.com/archives/equities/shortSelling/shortselling_18052017.csv
| | | freq | day
| | | sdt | 17 Jul 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | eod_vol | eg | https://www.nseindia.com/archives/nsccl/volt/CMVOLT_28032011.CSV
| | | url | https://www.nseindia.com/archives/nsccl/volt/CMVOLT_18052017.CSV
| | | freq | day
| | | sdt | 17 Apr 2011
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | ind_close | eg | https://nseindia.com/content/indices/ind_close_all_09052017.csv
| | | url | https://nseindia.com/content/indices/ind_close_all_18052017.csv
| | | freq | day
| | | sdt | 21 Feb 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | margintrd | eg | https://www.nseindia.com/archives/equities/margin/Margintrdg_130404.zip
| | | url | https://www.nseindia.com/archives/equities/margin/Margintrdg_180517.zip
| | | freq | day
| | | sdt | 13 Apr 2004
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cat_to | eg | https://www.nseindia.com/archives/equities/cat/cat_turnover_110405.xls
| | | url | https://www.nseindia.com/archives/equities/cat/cat_turnover_180517.xls
| | | freq | day
| | | sdt | 11 Apr 2005
https://github.com/bluechipcode/fetchbhavcopy 3/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | combrep | eg | https://www.nseindia.com/archives/combine_report/combined_report06082012.zip
| | | url | https://www.nseindia.com/archives/combine_report/combined_report18052017.zip
| | | freq | day
| | | sdt | 06 Aug 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | seccateg | eg | https://www.nseindia.com/archives/nsccl/mult/C_CATG_APR2003.T01
| | | url | https://www.nseindia.com/archives/nsccl/mult/C_CATG_JUN2017.T01
| | | freq | month
| | | sdt | 06 Aug 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | mcwb | eg | https://www.nseindia.com/content/indices/mcwb_jan08.zip
| | | url | https://www.nseindia.com/content/indices/mcwb_jun17.zip
| | | freq | month
| | | sdt | 01 Jan 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | imp_cost | eg | https://nseindia.com/content/indices/ind_ic_2001.zip
| | | url | https://nseindia.com/content/indices/ind_ic_2017.zip
| | | freq | year
| | | sdt | 01 Jan 2001
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | clifund1 | eg | https://www.nseindia.com/archives/equities/client/cli_fund_jul06.csv
| | | url | https://www.nseindia.com/archives/equities/client/cli_fund_jun17.csv
| | | freq | day
| | | sdt | 01 Jul 2006
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | ind_mcw | eg | https://nseindia.com/content/indices/indices_dataApr2013.zip
| | | url | https://nseindia.com/content/indices/indices_dataJun2017.zip
| | | freq | month
| | | sdt | 01 Apr 2014
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | fo_secban | eg | https://nseindia.com/archives/fo/sec_ban/fo_secban_01012008.csv
| | | url | https://nseindia.com/archives/fo/sec_ban/fo_secban_18052017.csv
https://github.com/bluechipcode/fetchbhavcopy 4/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
| | | freq | day
| | | sdt | 01 Jan 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | mar1 | eg | https://www.nseindia.com/archives/equities/mkt/mkt03012000.doc
| | | url | https://www.nseindia.com/archives/equities/mkt/mkt18052017.doc
| | | freq | day
| | | sdt | 03 Jan 2000
| | | edt | 17 Feb 2012
+------+---------------+------+--------------------------------------------------------------------------------
| nse | mar2 | eg | https://www.nseindia.com/archives/equities/mkt/MA200417.csv
| | | url | https://www.nseindia.com/archives/equities/mkt/MA180517.csv
| | | freq | day
| | | sdt | 21 Feb 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | fo_rep1 | eg | https://www.nseindia.com/archives/fo/mkt/fo050701.doc
| | | url | https://www.nseindia.com/archives/fo/mkt/fo180517.doc
| | | freq | day
| | | sdt | 05 Jul 2001
| | | edt | 22 Feb 2011
+------+---------------+------+--------------------------------------------------------------------------------
| nse | fo_rep2 | eg | https://www.nseindia.com/archives/fo/mkt/fo23022011.ZIP
| | | url | https://www.nseindia.com/archives/fo/mkt/fo18052017.zip
| | | freq | day
| | | sdt | 23 Feb 2011
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | fosett_prce | eg | https://nseindia.com/archives/nsccl/sett/FOSett_prce_19102001.csv
| | | url | https://nseindia.com/archives/nsccl/sett/FOSett_prce_18052017.csv
| | | freq | day
| | | sdt | 19 Oct 2001
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cli_poslimit | eg | https://nseindia.com/archives/nsccl/cli/oi_cli_limit_02-JAN-2002.lst
| | | url | https://nseindia.com/archives/nsccl/cli/oi_cli_limit_18-MAY-2017.lst
| | | freq | day
| | | sdt | 02 Jan 2002
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
https://github.com/bluechipcode/fetchbhavcopy 5/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdsett | eg | https://www.nseindia.com/archives/cd/sett/CDSett_prce_01092008.csv
| | | url | https://www.nseindia.com/archives/cd/sett/CDSett_prce_18052017.csv
| | | freq | day
| | | sdt | 01 Sep 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdvol | eg | https://www.nseindia.com/archives/cd/volt/X_VOLT_29082008.csv
| | | url | https://www.nseindia.com/archives/cd/volt/X_VOLT_18052017.csv
| | | freq | day
| | | sdt | 29 Aug 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdolim | eg | https://www.nseindia.com/archives/cd/cli/x_oi_cli_limit_29-AUG-2008.lst
| | | url | https://www.nseindia.com/archives/cd/cli/x_oi_cli_limit_18-JUN-2017.lst
| | | freq | day
| | | sdt | 29 Aug 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdtlim | eg | https://www.nseindia.com/archives/cd/cli/x_oi_tm_limit_29-AUG-2008.lst
| | | url | https://www.nseindia.com/archives/cd/cli/x_oi_tm_limit_18-JUN-2017.lst
| | | freq | day
| | | sdt | 29 Aug 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdbhav1 | eg | https://www.nseindia.com/archives/cd/bhav/CD_NSEUSDINR290808.dbf.zip
| | | url | https://www.nseindia.com/archives/cd/bhav/CD_NSEUSDINR180517.dbf.zip
| | | freq | day
| | | sdt | 29 Aug 2008
| | | edt | 27 Oct 2010
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdbhav2 | eg | https://www.nseindia.com/archives/cd/bhav/CD_Bhavcopy291010.zip
| | | url | https://www.nseindia.com/archives/cd/bhav/CD_Bhavcopy180517.zip
| | | freq | day
| | | sdt | 29 Oct 2010
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdmar1 | eg | https://www.nseindia.com/archives/cd/mkt_act/cd01092008.doc
| | | url | https://www.nseindia.com/archives/cd/mkt_act/cd18052017.doc
https://github.com/bluechipcode/fetchbhavcopy 7/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
| | | freq | day
| | | sdt | 01 Sep 2008
| | | edt | 28 Sep 2012
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdmar2 | eg | https://www.nseindia.com/archives/cd/mkt_act/cd01102012.zip
| | | url | https://www.nseindia.com/archives/cd/mkt_act/cd18052017.zip
| | | freq | day
| | | sdt | 01 Oct 2012
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdbp | eg | https://www.nseindia.com/archives/cd/bp/X_bp290808.csv
| | | url | https://www.nseindia.com/archives/cd/bp/X_bp180517.csv
| | | freq | day
| | | sdt | 29 Aug 2008
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | cdoiplim | eg | https://www.nseindia.com/archives/cd/cli/x_oi_pro_limit_29-OCT-2014.lst
| | | url | https://www.nseindia.com/archives/cd/cli/x_oi_pro_limit_18-JUN-2017.lst
| | | freq | day
| | | sdt | 29 Oct 2014
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | bnd_ewpl | eg | https://www.nseindia.com/archives/ird/ewpl/EWPL_08032016.CSV
| | | url | https://www.nseindia.com/archives/ird/ewpl/EWPL_18052017.CSV
| | | freq | day
| | | sdt | 08 Mar 2016
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
| nse | bndeod1 | eg | https://www.nseindia.com/archives/ird/bhav/IRF_NSE310809.dbf.zip
| | | url | https://www.nseindia.com/archives/ird/bhav/IRF_NSE180517.dbf.zip
| | | freq | day
| | | sdt | 31 Aug 2009
| | | edt | 15 Feb 2016
+------+---------------+------+--------------------------------------------------------------------------------
| nse | bndeod2 | eg | https://www.nseindia.com/archives/ird/bhav/IRF_NSE160216.csv
| | | url | https://www.nseindia.com/archives/ird/bhav/IRF_NSE180517.csv
| | | freq | day
| | | sdt | 16 Feb 2016
| | | edt | (none)
+------+---------------+------+--------------------------------------------------------------------------------
https://github.com/bluechipcode/fetchbhavcopy 8/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
usage: fetchbhavcopy.py [-h] [-d DUMP_DIR] [-a] [-r] [-l] [-p] [-t]
[-s START_DATE]
Sample usage:
fetchbhavcopy.py -d ..\data\dumps\bhavcopy -s "20 apr 2017"
fetchbhavcopy.py -d ..\data\dumps\bhavcopy -s "20 APR" #downloads from given date of current year
fetchbhavcopy.py -d ..\data\dumps\bhavcopy -s 2015 #from jan 1 2015
fetchbhavcopy.py -d ..\data\dumps\bhavcopy -s feb #from feb 1 of current year, case of month string doesnt
matter
fetchbhavcopy.py -d ..\data\dumps\bhavcopy -a #all available data - 20+ years for equities
fetchbhavcopy.py -d ..\data\dumps\bhavcopy #for last 2 weeks - default
fetchbhavcopy.py #for last 2 weeks and use default dump directory
optional arguments:
-h, --help show this help message and exit
-d DUMP_DIR, --dump-dir DUMP_DIR
https://github.com/bluechipcode/fetchbhavcopy 9/10
11/28/2019 GitHub - bluechipcode/fetchbhavcopy: Fetch EOD files from NSE/BSE bhavcopy
https://github.com/bluechipcode/fetchbhavcopy 10/10