eshan6704 commited on
Commit
c6a086e
·
verified ·
1 Parent(s): 74b4e8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -34
app.py CHANGED
@@ -10,43 +10,12 @@ from nsepython import *
10
  from yahooinfo import fetch_info
11
  import datetime
12
 
13
- # ======================================================
14
- # Scrollable HTML wrapper
15
- # ======================================================
16
- SCROLL_WRAP = """
17
- <div style="
18
- max-height: 80vh;
19
- overflow-y: auto;
20
- overflow-x: auto;
21
- padding: 10px;
22
- border: 1px solid #ccc;
23
- border-radius: 6px;
24
- ">
25
- {{HTML}}
26
- </div>
27
- """
28
 
29
- # ======================================================
30
- # Date helpers
31
- # ======================================================
32
- def today_str():
33
- return datetime.date.today().strftime("%d-%m-%Y")
34
 
35
- def yesterday_str():
36
- return (datetime.date.today() - datetime.timedelta(days=1)).strftime("%d-%m-%Y")
37
 
38
- def last_year_date(d):
39
- dt = datetime.datetime.strptime(d, "%d-%m-%Y")
40
- new_dt = dt.replace(year=dt.year - 1)
41
- return new_dt.strftime("%d-%m-%Y")
42
-
43
- # ======================================================
44
- # HTML wrapper
45
- # ======================================================
46
- def wrap(html):
47
- if html is None:
48
- return "<h3>No Data</h3>"
49
- return SCROLL_WRAP.replace("{{HTML}}", html)
50
 
51
  # ======================================================
52
  # Request Type Options
 
10
  from yahooinfo import fetch_info
11
  import datetime
12
 
13
+ from backblaze import upload_file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ file_name = f"bhav/bhav_{date_str.replace('-', '_')}.csv"
16
+ upload_file("eshanhf",file_name,df)
 
 
 
17
 
 
 
18
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  # ======================================================
21
  # Request Type Options