nsepython 2.92__py3-none-any.whl → 2.94__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
@@ -34,7 +34,7 @@ if(mode=='local'):
34
34
  def nsefetch(payload):
35
35
  try:
36
36
  output = requests.get(payload,headers=headers).json()
37
- print(output)
37
+ #print(output)
38
38
  except ValueError:
39
39
  s =requests.Session()
40
40
  output = s.get("http://nseindia.com",headers=headers)
@@ -42,19 +42,38 @@ if(mode=='local'):
42
42
  return output
43
43
 
44
44
 
45
+ # headers = {
46
+ # 'Connection': 'keep-alive',
47
+ # 'Cache-Control': 'max-age=0',
48
+ # 'DNT': '1',
49
+ # 'Upgrade-Insecure-Requests': '1',
50
+ # 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36',
51
+ # 'Sec-Fetch-User': '?1',
52
+ # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
53
+ # 'Sec-Fetch-Site': 'none',
54
+ # 'Sec-Fetch-Mode': 'navigate',
55
+ # 'Accept-Encoding': 'gzip, deflate, br',
56
+ # 'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8',
57
+ # }
58
+
59
+ #Rahul_Mittal's entry
45
60
  headers = {
46
- 'Connection': 'keep-alive',
47
- 'Cache-Control': 'max-age=0',
48
- 'DNT': '1',
49
- 'Upgrade-Insecure-Requests': '1',
50
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36',
51
- 'Sec-Fetch-User': '?1',
52
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
53
- 'Sec-Fetch-Site': 'none',
54
- 'Sec-Fetch-Mode': 'navigate',
55
- 'Accept-Encoding': 'gzip, deflate, br',
56
- 'Accept-Language': 'en-US,en;q=0.9,hi;q=0.8',
57
- }
61
+ "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
62
+ "accept-language": "en-US,en;q=0.9,en-IN;q=0.8,en-GB;q=0.7",
63
+ "cache-control": "max-age=0",
64
+ "priority": "u=0, i",
65
+ "sec-ch-ua": '"Microsoft Edge";v="129", "Not=A?Brand";v="8", "Chromium";v="129"',
66
+ "sec-ch-ua-mobile": "?0",
67
+ "sec-ch-ua-platform": '"Windows"',
68
+ "sec-fetch-dest": "document",
69
+ "sec-fetch-mode": "navigate",
70
+ "sec-fetch-site": "none",
71
+ "sec-fetch-user": "?1",
72
+ "upgrade-insecure-requests": "1",
73
+ "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0"
74
+ }
75
+
76
+
58
77
 
59
78
  #Curl headers
60
79
  curl_headers = ''' -H "authority: beta.nseindia.com" -H "cache-control: max-age=0" -H "dnt: 1" -H "upgrade-insecure-requests: 1" -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" -H "sec-fetch-user: ?1" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-site: none" -H "sec-fetch-mode: navigate" -H "accept-encoding: gzip, deflate, br" -H "accept-language: en-US,en;q=0.9,hi;q=0.8" --compressed'''
@@ -692,7 +711,7 @@ def expiry_history(symbol,start_date="",end_date="",type="options"):
692
711
  nsefetch_url = "https://www.nseindia.com/api/historical/fo/derivatives/meta?&from="+start_date+"&to="+end_date+"&symbol="+symbol+""
693
712
  payload = nsefetch(nsefetch_url)
694
713
 
695
- print(payload)
714
+ #print(payload)
696
715
 
697
716
  for key, value in payload['expiryDatesByInstrument'].items():
698
717
  if type.lower() == "options" and "OPT" in key:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsepython
3
- Version: 2.92
3
+ Version: 2.94
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=9RyVOJf9mvYcwTDetvT0hbOMBKnGsH1SQEoXW6XEUNQ,43208
3
+ nsepython-2.94.dist-info/LICENSE,sha256=7GKIR95QHGxZUfY_N5Or2XXBVRkLkyTRnZ_cLFyFw8s,35176
4
+ nsepython-2.94.dist-info/METADATA,sha256=vSl6h9a-R-XTUTDMTFw-Kxcv39kK8d9rOVhFBmZ4nYw,7420
5
+ nsepython-2.94.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
+ nsepython-2.94.dist-info/top_level.txt,sha256=-hTS08c-pS4rPpiuzLkamRsgHTq7t6BG0M5wnU-iPy4,10
7
+ nsepython-2.94.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- nsepython/__init__.py,sha256=smfUB46cZCC2tmcFMU6ry12PpWjKB4enB4Y5nNk_xBo,44
2
- nsepython/rahu.py,sha256=vRmnBqYMUDstMOOPFZR1XiG7c_A3Z1AjCB57FT6BYBg,42267
3
- nsepython-2.92.dist-info/LICENSE,sha256=7GKIR95QHGxZUfY_N5Or2XXBVRkLkyTRnZ_cLFyFw8s,35176
4
- nsepython-2.92.dist-info/METADATA,sha256=1K7VrHYcyYyVP26LhnF8msPnZDCvpVPpT909hVYM7AI,7420
5
- nsepython-2.92.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- nsepython-2.92.dist-info/top_level.txt,sha256=-hTS08c-pS4rPpiuzLkamRsgHTq7t6BG0M5wnU-iPy4,10
7
- nsepython-2.92.dist-info/RECORD,,