Update nsepython.py
Browse files- nsepython.py +4 -4
nsepython.py
CHANGED
|
@@ -182,9 +182,9 @@ def index_total_returns(sym,sd,ed):
|
|
| 182 |
p=json.loads(requests.post('https://niftyindices.com/Backpage.aspx/getTotalReturnIndexString', headers=niftyindices_headers, json=d).json()["d"])
|
| 183 |
return pd.DataFrame.from_records(p)
|
| 184 |
|
| 185 |
-
def
|
| 186 |
-
def
|
| 187 |
-
def
|
| 188 |
|
| 189 |
def nse_preopen(key="NIFTY"):
|
| 190 |
p=nsefetch("https://www.nseindia.com/api/market-data-pre-open?key="+key)
|
|
@@ -209,7 +209,7 @@ def nse_largedeals_historical(f,t,mode="bulk_deals"):
|
|
| 209 |
p=nsefetch(f'https://www.nseindia.com/api/historical/{m}?from={f}&to={t}')
|
| 210 |
return pd.DataFrame(p["data"])
|
| 211 |
|
| 212 |
-
def
|
| 213 |
url=f"https://www.nseindia.com/api/historical/securityArchives?from={f}&to={t}&symbol={symbol.upper()}&dataType=priceVolumeDeliverable&series={series}"
|
| 214 |
return pd.DataFrame(nsefetch(url)['data'])
|
| 215 |
|
|
|
|
| 182 |
p=json.loads(requests.post('https://niftyindices.com/Backpage.aspx/getTotalReturnIndexString', headers=niftyindices_headers, json=d).json()["d"])
|
| 183 |
return pd.DataFrame.from_records(p)
|
| 184 |
|
| 185 |
+
def nse_bhavcopy(d): return pd.read_csv("https://archives.nseindia.com/products/content/sec_bhavdata_full_"+d.replace("-","")+".csv")
|
| 186 |
+
def nse_bulkdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/bulk.csv")
|
| 187 |
+
def nse_blockdeals(): return pd.read_csv("https://archives.nseindia.com/content/equities/block.csv")
|
| 188 |
|
| 189 |
def nse_preopen(key="NIFTY"):
|
| 190 |
p=nsefetch("https://www.nseindia.com/api/market-data-pre-open?key="+key)
|
|
|
|
| 209 |
p=nsefetch(f'https://www.nseindia.com/api/historical/{m}?from={f}&to={t}')
|
| 210 |
return pd.DataFrame(p["data"])
|
| 211 |
|
| 212 |
+
def nse_stock_hist(f,t,symbol,series="ALL"):
|
| 213 |
url=f"https://www.nseindia.com/api/historical/securityArchives?from={f}&to={t}&symbol={symbol.upper()}&dataType=priceVolumeDeliverable&series={series}"
|
| 214 |
return pd.DataFrame(nsefetch(url)['data'])
|
| 215 |
|