Skip to content

Commit 2b7e3fc

Browse files
authored
Merge pull request #903 from aloner-pro/main
Added BSE data script
2 parents 77acb09 + 99a691b commit 2b7e3fc

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

BSE_data/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# BSE DATA
2+
3+
We can access `BOMBAY STOCK EXCHANGE` data through a package known as `bsedata`. Which can be found [here.](https://github.com/sdabhi23/bsedata)
4+
- Top gainers
5+
- Top losers
6+
- Scrips based on categories
7+
8+
## Setup instructions
9+
10+
Make sure that you have `bsedata` package installed for this.
11+
If not you can do it by
12+
```
13+
pip install bsedata
14+
```
15+
16+
Then just run the script.
17+
18+
## Author
19+
20+
[Sohel Ahmed](https://github.com/aloner-pro)
21+
22+
## Disclaimers
23+
24+
>Refrain from using this library if you are trying to query the stock exchange very very frequently. It increases load on BSE’s servers and might even lead to your IP address being blacklisted by them. Apart from the technical issues, it’s higly unethical.
25+
For frequent queries, consider buying data from BSE or a vendor. More details are available [here](https://www.bseindia.com/market_data_products.html)

BSE_data/bombay.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from bsedata.bse import BSE
2+
3+
b = BSE(update_codes=True)
4+
tg = b.topGainers()
5+
print("\nTOP GAINERS - Now\n")
6+
for i in tg:
7+
for j in i:
8+
print(j, i[j])
9+
10+
print('\n-------------------------\n')
11+
12+
tl = b.topLosers()
13+
print("\nTOP LOSERS - Now\n")
14+
for j in tl:
15+
for j in i:
16+
print(f"{j}: {i[j]}")
17+
18+
# indices catagory parameter
19+
category = ["market_cap/broad", "sector_and_industry", "thematics",
20+
"strategy", "sustainability", "volatility", "composite",
21+
"government", "corporate", "money_market"]
22+
23+
for i in category:
24+
indices = b.getIndices(category=i)
25+
print(f"\nIndices based on {i}")
26+
print(indices)
27+
28+
# Updates scrip code and updates library cache
29+
b.updateScripCodes()
30+
31+
# print(b.verifyScripCode(code))
32+
# print(b.getScripCodes)

0 commit comments

Comments
 (0)