eshan6704 commited on
Commit
331bb46
·
verified ·
1 Parent(s): aebccbf

Update app/app.py

Browse files
Files changed (1) hide show
  1. app/app.py +22 -23
app/app.py CHANGED
@@ -67,13 +67,13 @@ REQ_TYPE_MAP = {
67
  "split", "other", "stock_hist"
68
  ],
69
  "index": [
70
- "indices", "nse_open", "nse_preopen", "nse_fno",
71
- "nse_fiidii", "nse_events", "nse_future",
72
- "nse_highlow", "stock_highlow", "nse_bhav",
73
- "nse_largedeals", "nse_bulkdeals", "nse_blockdeals",
74
- "nse_most_active", "index_history",
75
- "largedeals_historical", "index_pe_pb_div",
76
- "index_total_returns"
77
  ],
78
  }
79
 
@@ -148,43 +148,42 @@ def handle_index(req: FetchRequest):
148
 
149
  if t == "indices":
150
  return indices.build_indices_html()
151
- if t == "nse_open":
152
  return live.build_index_live_html()
153
- if t == "nse_preopen":
154
  return pre.build_preopen_html()
155
- if t == "nse_fno":
156
  return fno.nse_fno_html(req.date_end, req.name)
157
- if t == "nse_fiidii":
158
  return ns.nse_fiidii()
159
- if t == "nse_events":
160
  return ns.nse_events()
161
- if t == "nse_future":
162
- return ns.nse_future(req.name)
163
- if t == "nse_highlow":
164
  return ns.nse_highlow(req.date_end)
165
  if t == "stock_highlow":
166
  return ns.stock_highlow(req.date_end)
167
- if t == "nse_bhav":
168
  return bhav.build_bhavcopy_html(req.date_end)
169
- if t == "nse_largedeals":
170
  return ns.nse_largedeals()
171
- if t == "nse_bulkdeals":
172
  return ns.nse_bulkdeals()
173
- if t == "nse_blockdeals":
174
  return ns.nse_blockdeals()
175
- if t == "nse_most_active":
176
  return ns.nse_most_active()
177
  if t == "index_history":
178
  return ns.index_history("NIFTY", req.date_start, req.date_end)
179
- if t == "largedeals_historical":
180
  return ns.nse_largedeals_historical(
181
  req.date_start, req.date_end
182
  )
183
- if t == "index_pe_pb_div":
184
  return ns.index_pe_pb_div(
185
  "NIFTY", req.date_start, req.date_end
186
  )
187
- if t == "index_total_returns":
188
  return ns.index_total_returns(
189
  "NIFTY", req.date_start, req.date_end
190
  )
 
67
  "split", "other", "stock_hist"
68
  ],
69
  "index": [
70
+ "indices", "open", "preopen", "fno",
71
+ "fiidii", "events",
72
+ "index_highlow", "stock_highlow", "bhav",
73
+ "largedeals", "bulkdeals", "blockdeals",
74
+ "most_active", "index_history",
75
+ "Hlargedeals", "pe_pb",
76
+ "total_returns"
77
  ],
78
  }
79
 
 
148
 
149
  if t == "indices":
150
  return indices.build_indices_html()
151
+ if t == "open":
152
  return live.build_index_live_html()
153
+ if t == "preopen":
154
  return pre.build_preopen_html()
155
+ if t == "fno":
156
  return fno.nse_fno_html(req.date_end, req.name)
157
+ if t == "fiidii":
158
  return ns.nse_fiidii()
159
+ if t == "events":
160
  return ns.nse_events()
161
+
162
+ if t == "index_highlow":
 
163
  return ns.nse_highlow(req.date_end)
164
  if t == "stock_highlow":
165
  return ns.stock_highlow(req.date_end)
166
+ if t == "bhav":
167
  return bhav.build_bhavcopy_html(req.date_end)
168
+ if t == "largedeals":
169
  return ns.nse_largedeals()
170
+ if t == "bulkdeals":
171
  return ns.nse_bulkdeals()
172
+ if t == "blockdeals":
173
  return ns.nse_blockdeals()
174
+ if t == "most_active":
175
  return ns.nse_most_active()
176
  if t == "index_history":
177
  return ns.index_history("NIFTY", req.date_start, req.date_end)
178
+ if t == "Hlargedeals":
179
  return ns.nse_largedeals_historical(
180
  req.date_start, req.date_end
181
  )
182
+ if t == "pe_pb":
183
  return ns.index_pe_pb_div(
184
  "NIFTY", req.date_start, req.date_end
185
  )
186
+ if t == "total_returns":
187
  return ns.index_total_returns(
188
  "NIFTY", req.date_start, req.date_end
189
  )