Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,40 +17,249 @@ AMCS = [
|
|
| 17 |
"UTI MF", "Axis MF", "Aditya Birla SL MF", "Mirae MF", "DSP MF"
|
| 18 |
]
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
COMPANIES = [
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
]
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
BUY_MAP = {
|
| 27 |
-
"SBI MF": [
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
"
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
SELL_MAP = {
|
| 40 |
-
"SBI MF": [
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
"
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
def sanitize_map(m):
|
| 56 |
out = {}
|
|
@@ -58,6 +267,7 @@ def sanitize_map(m):
|
|
| 58 |
out[k] = [v for v in vals if v in COMPANIES]
|
| 59 |
return out
|
| 60 |
|
|
|
|
| 61 |
BUY_MAP = sanitize_map(BUY_MAP)
|
| 62 |
SELL_MAP = sanitize_map(SELL_MAP)
|
| 63 |
COMPLETE_EXIT = sanitize_map(COMPLETE_EXIT)
|
|
|
|
| 17 |
"UTI MF", "Axis MF", "Aditya Birla SL MF", "Mirae MF", "DSP MF"
|
| 18 |
]
|
| 19 |
|
| 20 |
+
# ---------------------------
|
| 21 |
+
# COMPANIES (deduplicated + screenshot items)
|
| 22 |
+
# ---------------------------
|
| 23 |
COMPANIES = [
|
| 24 |
+
"Bajaj Finance","Adani Power","Infosys","ICICI Bank","HDFC Bank","NTPC",
|
| 25 |
+
"Power Grid Corporation Of India","Trent","Colgate-Palmolive (India)","ITC",
|
| 26 |
+
"Dixon Technologies (India)","Bank Of Maharashtra","Affle 3i",
|
| 27 |
+
"L&T Finance","Kotak Mahindra Bank","AU Small Finance Bank","Titan Company",
|
| 28 |
+
"Hindustan Unilever","Mankind Pharma","Shriram Finance","Tata Motors","Eternal",
|
| 29 |
+
"Mahindra & Mahindra","Glenmark Pharmaceuticals","Sundaram Finance","Tata Consultancy Services",
|
| 30 |
+
"Axis Bank","Dr. Reddy's Laboratories","Muthoot Finance","Avenue Supermarts",
|
| 31 |
+
"UNO Minda","Jindal Steel","ACC","Tata Steel","Vedanta","Godrej Industries",
|
| 32 |
+
"Berger Paints India","Tata Motors Passenger Vehicles","Bajaj Finserv",
|
| 33 |
+
"Bharti Airtel","Larsen & Toubro","Maruti Suzuki India","HDFC Asset Management Co",
|
| 34 |
+
"One97 Communications","Hyundai Motor India","Power Finance Corporation",
|
| 35 |
+
"Solar Industries India","HPCL","Fortis Healthcare",
|
| 36 |
+
"CEAT","NMDC","Ashok Leyland",
|
| 37 |
+
"Tata Elxsi","Avanti Feeds","Karur Vysya Bank","Indian Bank",
|
| 38 |
+
"Yatharth Hospital & Trauma Care","Dalmia Bharat","IREDA","HCC",
|
| 39 |
+
"Premier Energies","Welspon Corp","Zydus Lifesciences",
|
| 40 |
+
"Travel Food Services","Sai Silks (Kalamandir)",
|
| 41 |
+
"Sumitomo Chemical India","Adani Ports and SEZ",
|
| 42 |
+
"CESC",
|
| 43 |
+
"Canara Bank","MCX","Pearl Global Industries","Aditya Birla Lifestyle Brands",
|
| 44 |
+
"Angel One","Thyrocare Technologies","SJS Enterprises","Shilpa Medicare",
|
| 45 |
+
"Hindalco Industries","Tata Communications",
|
| 46 |
+
"Ujjivan Small Finance Bank","Steel Authority Of India",
|
| 47 |
+
"Shaily Engineering Plastics","Persistent Systems",
|
| 48 |
+
"Hindustan Aeronautics"
|
| 49 |
]
|
| 50 |
|
| 51 |
+
# ---------------------------
|
| 52 |
+
# BUY_MAP (from screenshot)
|
| 53 |
+
# ---------------------------
|
| 54 |
BUY_MAP = {
|
| 55 |
+
"SBI MF": [
|
| 56 |
+
"Bajaj Finance",
|
| 57 |
+
"Adani Power",
|
| 58 |
+
"Infosys"
|
| 59 |
+
],
|
| 60 |
+
"ICICI Pru MF": [
|
| 61 |
+
"ICICI Bank",
|
| 62 |
+
"HDFC Bank",
|
| 63 |
+
"NTPC"
|
| 64 |
+
],
|
| 65 |
+
"HDFC MF": [
|
| 66 |
+
"HDFC Bank",
|
| 67 |
+
"ICICI Bank",
|
| 68 |
+
"Power Grid Corporation Of India",
|
| 69 |
+
"Trent"
|
| 70 |
+
],
|
| 71 |
+
"Nippon India MF": [
|
| 72 |
+
"Trent",
|
| 73 |
+
"HDFC Bank",
|
| 74 |
+
"Colgate-Palmolive (India)",
|
| 75 |
+
"ITC"
|
| 76 |
+
],
|
| 77 |
+
"Kotak MF": [
|
| 78 |
+
"ITC",
|
| 79 |
+
"HDFC Bank",
|
| 80 |
+
"L&T Finance"
|
| 81 |
+
],
|
| 82 |
+
"UTI MF": [
|
| 83 |
+
"Dixon Technologies (India)",
|
| 84 |
+
"Bank Of Maharashtra",
|
| 85 |
+
"Affle 3i"
|
| 86 |
+
],
|
| 87 |
+
"Axis MF": [
|
| 88 |
+
"Kotak Mahindra Bank",
|
| 89 |
+
"AU Small Finance Bank",
|
| 90 |
+
"Titan Company"
|
| 91 |
+
],
|
| 92 |
+
"Aditya Birla SL MF": [
|
| 93 |
+
"Hindustan Unilever",
|
| 94 |
+
"Thyrocare Technologies",
|
| 95 |
+
"Mankind Pharma"
|
| 96 |
+
],
|
| 97 |
+
"Mirae MF": [
|
| 98 |
+
"ICICI Bank",
|
| 99 |
+
"Shriram Finance"
|
| 100 |
+
],
|
| 101 |
+
"DSP MF": [
|
| 102 |
+
"Tata Consultancy Services",
|
| 103 |
+
"Axis Bank"
|
| 104 |
+
]
|
| 105 |
}
|
| 106 |
|
| 107 |
+
# ---------------------------
|
| 108 |
+
# SELL_MAP (from screenshot)
|
| 109 |
+
# ---------------------------
|
| 110 |
SELL_MAP = {
|
| 111 |
+
"SBI MF": [
|
| 112 |
+
"HDFC Bank",
|
| 113 |
+
"ICICI Bank",
|
| 114 |
+
"Adani Ports and SEZ"
|
| 115 |
+
],
|
| 116 |
+
"ICICI Pru MF": [
|
| 117 |
+
"Bharti Airtel",
|
| 118 |
+
"Axis Bank",
|
| 119 |
+
"Larsen & Toubro",
|
| 120 |
+
"Maruti Suzuki India"
|
| 121 |
+
],
|
| 122 |
+
"HDFC MF": [
|
| 123 |
+
"NTPC",
|
| 124 |
+
"Tata Consultancy Services"
|
| 125 |
+
],
|
| 126 |
+
"Nippon India MF": [
|
| 127 |
+
"HDFC Asset Management Co",
|
| 128 |
+
"One97 Communications",
|
| 129 |
+
"Hyundai Motor India"
|
| 130 |
+
],
|
| 131 |
+
"Kotak MF": [
|
| 132 |
+
"Power Finance Corporation",
|
| 133 |
+
"Solar Industries India",
|
| 134 |
+
"HPCL"
|
| 135 |
+
],
|
| 136 |
+
"UTI MF": [
|
| 137 |
+
"Dr. Reddy's Laboratories",
|
| 138 |
+
"Bajaj Finance",
|
| 139 |
+
"Muthoot Finance",
|
| 140 |
+
"Avenue Supermarts"
|
| 141 |
+
],
|
| 142 |
+
"Axis MF": [
|
| 143 |
+
"Bajaj Finance",
|
| 144 |
+
"UNO Minda",
|
| 145 |
+
"Jindal Steel"
|
| 146 |
+
],
|
| 147 |
+
"Aditya Birla SL MF": [
|
| 148 |
+
"Fortis Healthcare",
|
| 149 |
+
"Mahindra & Mahindra",
|
| 150 |
+
"Suzlon Energy",
|
| 151 |
+
"Tata Steel",
|
| 152 |
+
"Vedanta",
|
| 153 |
+
"Ashok Leyland"
|
| 154 |
+
],
|
| 155 |
+
"Mirae MF": [
|
| 156 |
+
"Berger Paints India",
|
| 157 |
+
"Godrej Industries"
|
| 158 |
+
],
|
| 159 |
+
"DSP MF": [
|
| 160 |
+
"Bajaj Finance",
|
| 161 |
+
"Tata Motors Passenger Vehicles",
|
| 162 |
+
"Bajaj Finserv"
|
| 163 |
+
]
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
# ---------------------------
|
| 167 |
+
# COMPLETE_EXIT (from screenshot)
|
| 168 |
+
# ---------------------------
|
| 169 |
+
COMPLETE_EXIT = {
|
| 170 |
+
"ICICI Pru MF": [
|
| 171 |
+
"Tata Elxsi",
|
| 172 |
+
"Avanti Feeds"
|
| 173 |
+
],
|
| 174 |
+
"HDFC MF": [
|
| 175 |
+
"IREDA",
|
| 176 |
+
"HCC"
|
| 177 |
+
],
|
| 178 |
+
"Nippon India MF": [
|
| 179 |
+
"Premier Energies",
|
| 180 |
+
"Welspon Corp",
|
| 181 |
+
"Zydus Lifesciences"
|
| 182 |
+
],
|
| 183 |
+
"Kotak MF": [
|
| 184 |
+
"Travel Food Services",
|
| 185 |
+
"Colgate-Palmolive (India)"
|
| 186 |
+
],
|
| 187 |
+
"UTI MF": [
|
| 188 |
+
"Bajaj Finserv",
|
| 189 |
+
"Sai Silks (Kalamandir)"
|
| 190 |
+
],
|
| 191 |
+
"Axis MF": [
|
| 192 |
+
"Sumitomo Chemical India",
|
| 193 |
+
"Adani Ports and SEZ",
|
| 194 |
+
"CEAT",
|
| 195 |
+
"ACC"
|
| 196 |
+
],
|
| 197 |
+
"Aditya Birla SL MF": [
|
| 198 |
+
# screenshot shows no complete-exit items under ABSL; keep empty list to be explicit
|
| 199 |
+
],
|
| 200 |
+
"Mirae MF": [
|
| 201 |
+
"NMDC"
|
| 202 |
+
],
|
| 203 |
+
"DSP MF": [
|
| 204 |
+
"Praj Industries"
|
| 205 |
+
]
|
| 206 |
}
|
| 207 |
|
| 208 |
+
# Ensure empty list for Aditya Birla SL if the language of the file requires it:
|
| 209 |
+
COMPLETE_EXIT["Aditya Birla SL MF"] = COMPLETE_EXIT.get("Aditya Birla SL MF", [])
|
| 210 |
+
|
| 211 |
+
# ---------------------------
|
| 212 |
+
# FRESH_BUY (from screenshot)
|
| 213 |
+
# ---------------------------
|
| 214 |
+
FRESH_BUY = {
|
| 215 |
+
"SBI MF": [
|
| 216 |
+
"Canara Bank",
|
| 217 |
+
"MCX"
|
| 218 |
+
],
|
| 219 |
+
"ICICI Pru MF": [
|
| 220 |
+
"Pearl Global Industries",
|
| 221 |
+
"Aditya Birla Lifestyle Brands",
|
| 222 |
+
"Angel One"
|
| 223 |
+
],
|
| 224 |
+
"HDFC MF": [
|
| 225 |
+
"Shriram Finance",
|
| 226 |
+
"Thyrocare Technologies",
|
| 227 |
+
"SJS Enterprises",
|
| 228 |
+
"Shilpa Medicare"
|
| 229 |
+
],
|
| 230 |
+
"Nippon India MF": [
|
| 231 |
+
"UNO Minda",
|
| 232 |
+
"Hindalco Industries"
|
| 233 |
+
],
|
| 234 |
+
"Kotak MF": [
|
| 235 |
+
"Pearl Global Industries"
|
| 236 |
+
],
|
| 237 |
+
"UTI MF": [
|
| 238 |
+
"Tata Communications",
|
| 239 |
+
"Ujjivan Small Finance Bank",
|
| 240 |
+
"CESC"
|
| 241 |
+
],
|
| 242 |
+
"Axis MF": [
|
| 243 |
+
"Adani Power",
|
| 244 |
+
"Steel Authority Of India",
|
| 245 |
+
"Shaily Engineering Plastics",
|
| 246 |
+
"Persistent Systems",
|
| 247 |
+
"Hindustan Aeronautics"
|
| 248 |
+
],
|
| 249 |
+
"Aditya Birla SL MF": [
|
| 250 |
+
"Eternal",
|
| 251 |
+
"Hindustan Aeronautics",
|
| 252 |
+
"Ujjivan Small Finance Bank"
|
| 253 |
+
],
|
| 254 |
+
"Mirae MF": [
|
| 255 |
+
# empty in screenshot
|
| 256 |
+
],
|
| 257 |
+
"DSP MF": [
|
| 258 |
+
"Eternal",
|
| 259 |
+
"Hindustan Aeronautics",
|
| 260 |
+
"Ujjivan Small Finance Bank"
|
| 261 |
+
]
|
| 262 |
+
}
|
| 263 |
|
| 264 |
def sanitize_map(m):
|
| 265 |
out = {}
|
|
|
|
| 267 |
out[k] = [v for v in vals if v in COMPANIES]
|
| 268 |
return out
|
| 269 |
|
| 270 |
+
# sanitize_map call will keep only items present in COMPANIES
|
| 271 |
BUY_MAP = sanitize_map(BUY_MAP)
|
| 272 |
SELL_MAP = sanitize_map(SELL_MAP)
|
| 273 |
COMPLETE_EXIT = sanitize_map(COMPLETE_EXIT)
|