nsepython 2.7__py3-none-any.whl → 2.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nsepython/rahu.py CHANGED
@@ -628,6 +628,7 @@ def derivative_history_virgin(symbol,start_date,end_date,instrumentType,expiry_d
628
628
  logging.info(nsefetch_url)
629
629
  logging.info(payload)
630
630
  return pd.DataFrame.from_records(payload["data"])
631
+
631
632
  def derivative_history(symbol,start_date,end_date,instrumentType,expiry_date,strikePrice="",optionType=""):
632
633
  #We are getting the input in text. So it is being converted to Datetime object from String.
633
634
  start_date = datetime.datetime.strptime(start_date, "%d-%m-%Y")
@@ -742,21 +743,21 @@ niftyindices_headers = {
742
743
  }
743
744
 
744
745
  def index_history(symbol,start_date,end_date):
745
- data = "{'name':'"+symbol+"','startDate':'"+start_date+"','endDate':'"+end_date+"'}"
746
+ data = {'cinfo': "{'name':'" + symbol + "','startDate':'" + start_date + "','endDate':'" + end_date + "','indexName':'" + symbol + "'}"}
746
747
  payload = requests.post('https://niftyindices.com/Backpage.aspx/getHistoricaldatatabletoString', headers=niftyindices_headers, data=data).json()
747
748
  payload = json.loads(payload["d"])
748
749
  payload=pd.DataFrame.from_records(payload)
749
750
  return payload
750
751
 
751
752
  def index_pe_pb_div(symbol,start_date,end_date):
752
- data = "{'name':'"+symbol+"','startDate':'"+start_date+"','endDate':'"+end_date+"'}"
753
+ data = {'cinfo': "{'name':'" + symbol + "','startDate':'" + start_date + "','endDate':'" + end_date + "','indexName':'" + symbol + "'}"}
753
754
  payload = requests.post('https://niftyindices.com/Backpage.aspx/getpepbHistoricaldataDBtoString', headers=niftyindices_headers, data=data).json()
754
755
  payload = json.loads(payload["d"])
755
756
  payload=pd.DataFrame.from_records(payload)
756
757
  return payload
757
758
 
758
759
  def index_total_returns(symbol,start_date,end_date):
759
- data = "{'name':'"+symbol+"','startDate':'"+start_date+"','endDate':'"+end_date+"'}"
760
+ data = {'cinfo': "{'name':'" + symbol + "','startDate':'" + start_date + "','endDate':'" + end_date + "','indexName':'" + symbol + "'}"}
760
761
  payload = requests.post('https://niftyindices.com/Backpage.aspx/getTotalReturnIndexString', headers=niftyindices_headers, data=data).json()
761
762
  payload = json.loads(payload["d"])
762
763
  payload=pd.DataFrame.from_records(payload)
@@ -925,4 +926,10 @@ def nse_expirydetails_by_symbol(symbol,meta ="Futures",i=0):
925
926
  currentExpiry=expiry_dates[i]
926
927
  currentExpiry = datetime.datetime.strptime(currentExpiry,'%d-%b-%Y').date()
927
928
  dte = (currentExpiry - datetime.datetime.now().date()).days
928
- return currentExpiry,dte
929
+ return currentExpiry,dte
930
+
931
+ def security_wise_archive(from_date, to_date, symbol, series="ALL"):
932
+ base_url = "https://www.nseindia.com/api/historical/securityArchives"
933
+ url = f"{base_url}?from={from_date}&to={to_date}&symbol={symbol.upper()}&dataType=priceVolumeDeliverable&series={series.upper()}"
934
+ payload = nsefetch(url)
935
+ return pd.DataFrame(payload['data'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsepython
3
- Version: 2.7
3
+ Version: 2.9
4
4
  Summary: Python library for NSE India APIs
5
5
  Home-page: https://github.com/aeron7/nsepython
6
6
  Author: Aeron7
@@ -0,0 +1,7 @@
1
+ nsepython/__init__.py,sha256=smfUB46cZCC2tmcFMU6ry12PpWjKB4enB4Y5nNk_xBo,44
2
+ nsepython/rahu.py,sha256=zqJCo-l-m86jTmGW81dNvhQ9ZXcDPR-yyPrcUl9Wq-k,42267
3
+ nsepython-2.9.dist-info/LICENSE,sha256=7GKIR95QHGxZUfY_N5Or2XXBVRkLkyTRnZ_cLFyFw8s,35176
4
+ nsepython-2.9.dist-info/METADATA,sha256=CPttDNg8POe0it2jun5X3wD6LtG4r9AZAET1Hm5idfY,7419
5
+ nsepython-2.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
+ nsepython-2.9.dist-info/top_level.txt,sha256=-hTS08c-pS4rPpiuzLkamRsgHTq7t6BG0M5wnU-iPy4,10
7
+ nsepython-2.9.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- nsepython/__init__.py,sha256=smfUB46cZCC2tmcFMU6ry12PpWjKB4enB4Y5nNk_xBo,44
2
- nsepython/rahu.py,sha256=ZVvrGdW5FPt3gOpfcxuPCH-YipXWuZK5CG11-ejBHv0,41753
3
- nsepython-2.7.dist-info/LICENSE,sha256=7GKIR95QHGxZUfY_N5Or2XXBVRkLkyTRnZ_cLFyFw8s,35176
4
- nsepython-2.7.dist-info/METADATA,sha256=f9Zc8CkDpC9xa886-8cv88f00CWKKGAZ7Yexy7UEOmY,7419
5
- nsepython-2.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- nsepython-2.7.dist-info/top_level.txt,sha256=-hTS08c-pS4rPpiuzLkamRsgHTq7t6BG0M5wnU-iPy4,10
7
- nsepython-2.7.dist-info/RECORD,,