eshan6704 commited on
Commit
fe540a3
·
verified ·
1 Parent(s): 5b4cc02

Update app/nsepythonmodified.py

Browse files
Files changed (1) hide show
  1. app/nsepythonmodified.py +3 -3
app/nsepythonmodified.py CHANGED
@@ -261,8 +261,8 @@ def index_total_returns(symbol, start_date, end_date):
261
 
262
  # ------------------------- CSV / BHAV -------------------------
263
  def nse_bhavcopy(d): return pd.read_csv("https://archives.nseindia.com/products/content/sec_bhavdata_full_"+d.replace("-","")+".csv")
264
- def nse_bulkdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/bulk.csv")
265
- def nse_blockdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/block.csv")
266
 
267
  def nse_preopen(key="NIFTY"):
268
  p=nsefetch("https://www.nseindia.com/api/market-data-pre-open?key="+key)
@@ -280,7 +280,7 @@ def nse_price_band_hitters(b="both",v="AllSec"):
280
 
281
  def nse_largedeals(mode="bulk_deals"):
282
  p=nsefetch('https://www.nseindia.com/api/snapshot-capital-market-largedeal')
283
- return pd.DataFrame(p["BULK_DEALS_DATA" if mode=="bulk_deals" else "SHORT_DEALS_DATA" if mode=="short_deals" else "BLOCK_DEALS_DATA"])
284
 
285
  def nse_largedeals_historical(f,t,mode="bulk_deals"):
286
  m = "bulk-deals" if mode=="bulk_deals" else "short-selling" if mode=="short_deals" else "block-deals"
 
261
 
262
  # ------------------------- CSV / BHAV -------------------------
263
  def nse_bhavcopy(d): return pd.read_csv("https://archives.nseindia.com/products/content/sec_bhavdata_full_"+d.replace("-","")+".csv")
264
+ def nse_bulkdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/bulk.csv").to_html()
265
+ def nse_blockdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/block.csv").to_html()
266
 
267
  def nse_preopen(key="NIFTY"):
268
  p=nsefetch("https://www.nseindia.com/api/market-data-pre-open?key="+key)
 
280
 
281
  def nse_largedeals(mode="bulk_deals"):
282
  p=nsefetch('https://www.nseindia.com/api/snapshot-capital-market-largedeal')
283
+ return pd.DataFrame(p["BULK_DEALS_DATA" if mode=="bulk_deals" else "SHORT_DEALS_DATA" if mode=="short_deals" else "BLOCK_DEALS_DATA"]).to_html()
284
 
285
  def nse_largedeals_historical(f,t,mode="bulk_deals"):
286
  m = "bulk-deals" if mode=="bulk_deals" else "short-selling" if mode=="short_deals" else "block-deals"