nsepython 2.94__tar.gz → 2.95__tar.gz
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-2.94 → nsepython-2.95}/PKG-INFO +14 -2
- {nsepython-2.94 → nsepython-2.95}/nsepython/rahu.py +33 -21
- {nsepython-2.94 → nsepython-2.95}/nsepython.egg-info/PKG-INFO +14 -2
- {nsepython-2.94 → nsepython-2.95}/setup.py +2 -1
- {nsepython-2.94 → nsepython-2.95}/LICENSE +0 -0
- {nsepython-2.94 → nsepython-2.95}/README.md +0 -0
- {nsepython-2.94 → nsepython-2.95}/nsepython/__init__.py +0 -0
- {nsepython-2.94 → nsepython-2.95}/nsepython.egg-info/SOURCES.txt +0 -0
- {nsepython-2.94 → nsepython-2.95}/nsepython.egg-info/dependency_links.txt +0 -0
- {nsepython-2.94 → nsepython-2.95}/nsepython.egg-info/requires.txt +0 -0
- {nsepython-2.94 → nsepython-2.95}/nsepython.egg-info/top_level.txt +0 -0
- {nsepython-2.94 → nsepython-2.95}/setup.cfg +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: nsepython
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.95
|
|
4
4
|
Summary: Python library for NSE India APIs
|
|
5
5
|
Home-page: https://github.com/aeron7/nsepython
|
|
6
6
|
Author: Aeron7
|
|
7
7
|
Author-email: dexter@unofficed.com
|
|
8
|
+
License: GNU
|
|
8
9
|
Keywords: nseindia,nse,python,sdk,trading,stock markets
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
11
|
Classifier: Natural Language :: English
|
|
@@ -18,6 +19,17 @@ License-File: LICENSE
|
|
|
18
19
|
Requires-Dist: requests
|
|
19
20
|
Requires-Dist: pandas
|
|
20
21
|
Requires-Dist: scipy
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: keywords
|
|
29
|
+
Dynamic: license
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: summary
|
|
21
33
|
|
|
22
34
|
<p align="left">
|
|
23
35
|
<a href="https://aeron7.github.io/nsepython/" target="_blank">
|
|
@@ -13,32 +13,44 @@ import urllib.parse
|
|
|
13
13
|
|
|
14
14
|
mode ='local'
|
|
15
15
|
|
|
16
|
-
if
|
|
17
|
-
def nsefetch(payload):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if mode == "vpn":
|
|
17
|
+
def nsefetch(payload: str):
|
|
18
|
+
def encode(url: str) -> str:
|
|
19
|
+
if "%26" in url or "%20" in url:
|
|
20
|
+
return url
|
|
21
|
+
return urllib.parse.quote(url, safe=":/?&=")
|
|
22
|
+
|
|
23
|
+
def refresh_cookies():
|
|
24
|
+
os.popen(f'curl -c cookies.txt "https://www.nseindia.com" {curl_headers}').read()
|
|
25
|
+
os.popen(f'curl -b cookies.txt -c cookies.txt "https://www.nseindia.com/option-chain" {curl_headers}').read()
|
|
26
|
+
|
|
27
|
+
if not os.path.exists("cookies.txt"):
|
|
28
|
+
refresh_cookies()
|
|
29
|
+
|
|
30
|
+
encoded_url = encode(payload)
|
|
31
|
+
cmd = f'curl -b cookies.txt "{encoded_url}" {curl_headers}'
|
|
32
|
+
raw = os.popen(cmd).read()
|
|
33
|
+
|
|
23
34
|
try:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
return json.loads(raw)
|
|
36
|
+
except ValueError:
|
|
37
|
+
refresh_cookies()
|
|
38
|
+
raw = os.popen(cmd).read()
|
|
39
|
+
try:
|
|
40
|
+
return json.loads(raw)
|
|
41
|
+
except ValueError:
|
|
42
|
+
return {}
|
|
43
|
+
|
|
33
44
|
if(mode=='local'):
|
|
34
45
|
def nsefetch(payload):
|
|
46
|
+
|
|
35
47
|
try:
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
s = requests.Session()
|
|
49
|
+
s.get("https://www.nseindia.com", headers=headers, timeout=10)
|
|
50
|
+
s.get("https://www.nseindia.com/option-chain", headers=headers, timeout=10)
|
|
51
|
+
output = s.get(payload, headers=headers, timeout=10).json()
|
|
38
52
|
except ValueError:
|
|
39
|
-
|
|
40
|
-
output = s.get("http://nseindia.com",headers=headers)
|
|
41
|
-
output = s.get(payload,headers=headers).json()
|
|
53
|
+
output = {}
|
|
42
54
|
return output
|
|
43
55
|
|
|
44
56
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: nsepython
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.95
|
|
4
4
|
Summary: Python library for NSE India APIs
|
|
5
5
|
Home-page: https://github.com/aeron7/nsepython
|
|
6
6
|
Author: Aeron7
|
|
7
7
|
Author-email: dexter@unofficed.com
|
|
8
|
+
License: GNU
|
|
8
9
|
Keywords: nseindia,nse,python,sdk,trading,stock markets
|
|
9
10
|
Classifier: Intended Audience :: Developers
|
|
10
11
|
Classifier: Natural Language :: English
|
|
@@ -18,6 +19,17 @@ License-File: LICENSE
|
|
|
18
19
|
Requires-Dist: requests
|
|
19
20
|
Requires-Dist: pandas
|
|
20
21
|
Requires-Dist: scipy
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: keywords
|
|
29
|
+
Dynamic: license
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: summary
|
|
21
33
|
|
|
22
34
|
<p align="left">
|
|
23
35
|
<a href="https://aeron7.github.io/nsepython/" target="_blank">
|
|
@@ -6,7 +6,8 @@ with open("README.md", "r") as fh:
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name = 'nsepython',
|
|
8
8
|
packages=setuptools.find_packages(),
|
|
9
|
-
version = '2.
|
|
9
|
+
version = '2.95',
|
|
10
|
+
license='GNU',
|
|
10
11
|
include_package_data=True,
|
|
11
12
|
description = 'Python library for NSE India APIs',
|
|
12
13
|
long_description=long_description,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|