nsemine 0.1.0__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.
- nsemine-0.1.0/LICENSE +21 -0
- nsemine-0.1.0/PKG-INFO +32 -0
- nsemine-0.1.0/README.md +2 -0
- nsemine-0.1.0/nsemine/__init__.py +0 -0
- nsemine-0.1.0/nsemine/bin/__init__.py +0 -0
- nsemine-0.1.0/nsemine/bin/scraper.py +18 -0
- nsemine-0.1.0/nsemine/fno.py +0 -0
- nsemine-0.1.0/nsemine/generic.py +27 -0
- nsemine-0.1.0/nsemine/indices.py +12 -0
- nsemine-0.1.0/nsemine/stocks.py +0 -0
- nsemine-0.1.0/nsemine/utilities/__init__.py +0 -0
- nsemine-0.1.0/nsemine/utilities/urls.py +1 -0
- nsemine-0.1.0/nsemine/utilities/utils.py +15 -0
- nsemine-0.1.0/nsemine.egg-info/PKG-INFO +32 -0
- nsemine-0.1.0/nsemine.egg-info/SOURCES.txt +18 -0
- nsemine-0.1.0/nsemine.egg-info/dependency_links.txt +1 -0
- nsemine-0.1.0/nsemine.egg-info/requires.txt +12 -0
- nsemine-0.1.0/nsemine.egg-info/top_level.txt +1 -0
- nsemine-0.1.0/pyproject.toml +44 -0
- nsemine-0.1.0/setup.cfg +4 -0
nsemine-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kartick Bhowmik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
nsemine-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nsemine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Simplest and Cleanest Python Library to Scrape Data From The NSEIndia(NEW) and NiftyIndices Website.
|
|
5
|
+
Author-email: kbizme <kbhowmik.eduz@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/kbizme/nsemine
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/kbizme/nsemine/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
12
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
14
|
+
Requires-Python: >=3.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: asyncio
|
|
18
|
+
Requires-Dist: certifi
|
|
19
|
+
Requires-Dist: charset-normalizer
|
|
20
|
+
Requires-Dist: idna
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: python-dateutil
|
|
24
|
+
Requires-Dist: pytz
|
|
25
|
+
Requires-Dist: requests
|
|
26
|
+
Requires-Dist: six
|
|
27
|
+
Requires-Dist: tzdata
|
|
28
|
+
Requires-Dist: urllib3
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Simplest and Cleanest Python Library to Scrape Data From The NSEIndia(NEW) and NiftyIndices Website.
|
|
32
|
+
|
nsemine-0.1.0/README.md
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import Any, Union
|
|
2
|
+
import requests
|
|
3
|
+
from nsemine.utilities import utils
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_request(url: str, params: Any = None):
|
|
8
|
+
try:
|
|
9
|
+
response = requests.get(url=url, headers=utils.api_headers, params=params)
|
|
10
|
+
response.raise_for_status()
|
|
11
|
+
if response.status_code == 200:
|
|
12
|
+
return response
|
|
13
|
+
return None
|
|
14
|
+
|
|
15
|
+
except Exception as e:
|
|
16
|
+
print('Error while making the request to nse website:', e)()
|
|
17
|
+
|
|
18
|
+
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from nsemine.bin import scraper
|
|
2
|
+
from nsemine.utilities import urls
|
|
3
|
+
from typing import Union
|
|
4
|
+
import json
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_all_indices_names() -> Union[pd.DataFrame, None]:
|
|
10
|
+
"""
|
|
11
|
+
This functions fetches all the available indices at NSE Exchange.
|
|
12
|
+
Returns:
|
|
13
|
+
df (DataFrame) : Pandas DataFrame containing all the nse indices names.
|
|
14
|
+
|
|
15
|
+
Returns None, if any error occurred.
|
|
16
|
+
"""
|
|
17
|
+
try:
|
|
18
|
+
resp = scraper.get_request(url=urls.nifty_index_maping)
|
|
19
|
+
if resp:
|
|
20
|
+
data = resp.text
|
|
21
|
+
if data.startswith('\ufeff'):
|
|
22
|
+
data = json.loads(data[1:])
|
|
23
|
+
df = pd.DataFrame(data)
|
|
24
|
+
df.columns = ['trading_index', 'full_name']
|
|
25
|
+
return df
|
|
26
|
+
except Exception as e:
|
|
27
|
+
print('Error Occurred in get_all_indices_names():', e)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nifty_index_maping = 'https://iislliveblob.niftyindices.com/assets/json/IndexMapping.json'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
api_headers = {
|
|
2
|
+
"accept": "text/html,application/xhtml+xml,text/csv,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
3
|
+
"accept-language": "en-US,en;q=0.9,en-IN;q=0.8,en-GB;q=0.7",
|
|
4
|
+
"cache-control": "max-age=0",
|
|
5
|
+
"priority": "u=0, i",
|
|
6
|
+
"sec-ch-ua": '"Microsoft Edge";v="129", "Not=A?Brand";v="8", "Chromium";v="129"',
|
|
7
|
+
"sec-ch-ua-mobile": "?0",
|
|
8
|
+
"sec-ch-ua-platform": '"Windows"',
|
|
9
|
+
"sec-fetch-dest": "document",
|
|
10
|
+
"sec-fetch-mode": "navigate",
|
|
11
|
+
"sec-fetch-site": "none",
|
|
12
|
+
"sec-fetch-user": "?1",
|
|
13
|
+
"upgrade-insecure-requests": "1",
|
|
14
|
+
"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"
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nsemine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Simplest and Cleanest Python Library to Scrape Data From The NSEIndia(NEW) and NiftyIndices Website.
|
|
5
|
+
Author-email: kbizme <kbhowmik.eduz@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/kbizme/nsemine
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/kbizme/nsemine/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
12
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
14
|
+
Requires-Python: >=3.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: asyncio
|
|
18
|
+
Requires-Dist: certifi
|
|
19
|
+
Requires-Dist: charset-normalizer
|
|
20
|
+
Requires-Dist: idna
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: python-dateutil
|
|
24
|
+
Requires-Dist: pytz
|
|
25
|
+
Requires-Dist: requests
|
|
26
|
+
Requires-Dist: six
|
|
27
|
+
Requires-Dist: tzdata
|
|
28
|
+
Requires-Dist: urllib3
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Simplest and Cleanest Python Library to Scrape Data From The NSEIndia(NEW) and NiftyIndices Website.
|
|
32
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
nsemine/__init__.py
|
|
5
|
+
nsemine/fno.py
|
|
6
|
+
nsemine/generic.py
|
|
7
|
+
nsemine/indices.py
|
|
8
|
+
nsemine/stocks.py
|
|
9
|
+
nsemine.egg-info/PKG-INFO
|
|
10
|
+
nsemine.egg-info/SOURCES.txt
|
|
11
|
+
nsemine.egg-info/dependency_links.txt
|
|
12
|
+
nsemine.egg-info/requires.txt
|
|
13
|
+
nsemine.egg-info/top_level.txt
|
|
14
|
+
nsemine/bin/__init__.py
|
|
15
|
+
nsemine/bin/scraper.py
|
|
16
|
+
nsemine/utilities/__init__.py
|
|
17
|
+
nsemine/utilities/urls.py
|
|
18
|
+
nsemine/utilities/utils.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nsemine
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nsemine"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "kbizme", email = "kbhowmik.eduz@gmail.com" }
|
|
10
|
+
]
|
|
11
|
+
description = "Simplest and Cleanest Python Library to Scrape Data From The NSEIndia(NEW) and NiftyIndices Website."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.6"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Office/Business :: Financial",
|
|
19
|
+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
|
20
|
+
"Topic :: Software Development :: Libraries",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
dependencies = [
|
|
24
|
+
"asyncio",
|
|
25
|
+
"certifi",
|
|
26
|
+
"charset-normalizer",
|
|
27
|
+
"idna",
|
|
28
|
+
"numpy",
|
|
29
|
+
"pandas",
|
|
30
|
+
"python-dateutil",
|
|
31
|
+
"pytz",
|
|
32
|
+
"requests",
|
|
33
|
+
"six",
|
|
34
|
+
"tzdata",
|
|
35
|
+
"urllib3",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[tool.setuptools]
|
|
40
|
+
packages = ["nsemine", "nsemine.bin", "nsemine.utilities"]
|
|
41
|
+
|
|
42
|
+
[project.urls]
|
|
43
|
+
"Homepage" = "https://github.com/kbizme/nsemine"
|
|
44
|
+
"Bug Tracker" = "https://github.com/kbizme/nsemine/issues"
|
nsemine-0.1.0/setup.cfg
ADDED