Package: nsedt
NSE (national stock exchange) dataIntroduction:
This library serves as an api to fetch data from the NSE about stocks and indices and derivatives using pythonThank you for using Nsedt. Please feel free to send pull requests, comments, and suggestions, as well as get in touch with me if you require any additional help. I sincerely hope you will find this library useful.For detailed doc please refernse-docHow to startclone the repositorygit clone https://github.com/pratik141/nsedtInstall the requirements file after changing to cloned folder abovepip install -r requirements.txtInstall locallypip installl . --upgradeEquityDetailsNameModule nameDescriptionArgumentResponsecompanyinfoget_companyinfoCompany infosymbol , response_typejson, panda dfmarketstatusget_marketstatusmarketstatus--panda_dfpriceget_pricepricestart_date, end_date, symbol, input_typejson, panda dfcorpinfoget_corpinfocorpinfoargeventget_eventeventstart_date, end_datepanda dfchartdataget_chartdatachartdatasymbolpanda dfsymbols_listget_symbols_listsymbols_list--jsonasm_listget_asm_listsymbols_listasm_typejsonNow get_price work with start_date, end_date without datetime format it support%d-%m-%Ystep to runfromnsedtimportequityaseqfromdatetimeimportdatestart_date=date(2023,1,1)end_date=date(2023,1,10)print(eq.get_price(start_date,end_date,symbol="TCS"))start_date="01-05-2023"end_date="03-05-2023"print(eq.get_corpinfo(start_date,end_date,symbol="TCS"))print(eq.get_event(start_date,end_date))print(eq.get_event())print(eq.get_marketstatus())print(eq.get_marketstatus(response_type="json"))print(eq.get_companyinfo(symbol="TCS"))print(eq.get_companyinfo(symbol="TCS",response_type="json"))print(eq.get_chartdata(symbol="TCS"))print(eq.get_symbols_list())#print the list of symbols used by NSE for equitiesprint(eq.get_asm_list(asm_type="shortterm"))IndicesDetailsNameModule nameDescriptionArgumentResponsepriceget_pricepricestart_date, end_date, symbolpanda dfstep to runfromnsedtimportindicesasindfromdatetimeimportdatestart_date=date(2023,1,1)end_date=date(2023,1,10)print(ind.get_price(start_date=start_date,end_date=end_date,symbol="NIFTY 50"))data=ind.get_price(start_date=start_date,end_date=end_date,symbol="NIFTY")# To change date format from '%d-%b-%Y' to '%Y-%m-%d'data["Date"]=pd.to_datetime(data["Date"],format='%d-%b-%Y')DerivativesDetailsNameModule nameDescriptionArgumentResponsevixget_vixpricestart_date, end_date,columns_drop_listpanda dfoption chainget_option_chainget option  pricesymbol,strikePrice,expiryDatepanda dfoption chain expiry dateget_option_chain_expdateoption chain expiry datesymboljsonfuture priceget_future_priceget future pricesymbol, start_date, end_date, expiryDate,response_type, columns_drop_listpanda dffuture expiry dateget_future_expdatefuture expiry datesymboljsonstep to runfromnsedtimportderivativesasdestart_date="01-09-2023"end_date="03-09-2023"# date format "%d-%m-%Y"print(de.get_vix(start_date,end_date))print(de.get_option_chain_expdate(symbol="TCS"))print(de.get_option_chain(symbol="TCS",strike_price=3300,expiry_date="expiryDate"))print(de.get_future_price(symbol="TCS",start_date=start_date,end_date=end_date))print(de.get_future_expdate(symbol="TCS"))