Skip to content

Commit ec41062

Browse files
committed
Made it better
1 parent 4d5c65e commit ec41062

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

BSE_data/bombay.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1+
from unicodedata import category
12
from bsedata.bse import BSE
23

34
b = BSE(update_codes = True)
45
tg = b.topGainers()
5-
print("Top Gainers - Now")
6+
print("\nTOP GAINERS - Now\n")
67
for i in tg:
7-
print(i)
8+
for j in i:
9+
print(j, i[j])
810

911
print('\n-------------------------\n')
1012

1113
tl = b.topLosers()
12-
print("Top Losers - Now")
14+
print("\nTOP LOSERS - Now\n")
1315
for j in tl:
14-
print(j)
16+
for j in i:
17+
print(f"{j}: {i[j]}")
1518

1619
# indices catagory parameter
17-
'''
18-
market_cap/broad, sector_and_industry, thematics, strategy
19-
sustainability, volatility, composite, government, corporate, money_market
20-
'''
21-
indices = b.getIndices(category='government')
22-
print(indices)
20+
category = ["market_cap/broad", "sector_and_industry", "thematics", "strategy",
21+
"sustainability", "volatility", "composite", "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)
2327

2428
# Updates scrip code and updates library cache
2529
b.updateScripCodes()

0 commit comments

Comments
 (0)