-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp_v4.py
62 lines (45 loc) · 1.35 KB
/
app_v4.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# from types import NoneType
from flask import Flask, render_template, request, url_for, jsonify
import numpy as np
import joblib
import json
from joblib import load
import pandas as pd
from input_v3 import Model
import yfinance as yf
# from keras.models import load_model
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from datetime import date
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def main():
# If a form is submitted
if request.method == "POST":
# Get values through input bars
ticker = request.form.get("Ticker")
SPF = Model()
data = SPF.extract_data(ticker)
# Get prediction
stock_prediction = SPF.reshape_model()
else:
stock_prediction = ""
return render_template("index.html", output = stock_prediction)
@app.route('/getstarted')
def getstarted():
app.static_folder = 'static'
return render_template("getstarted.html")
@app.route('/crypto')
def crypto():
app.static_folder = 'static'
return render_template("crypto.html")
@app.route('/calendar')
def calendar():
app.static_folder = 'static'
return render_template("calendar.html")
@app.route('/sp500')
def sp500():
app.static_folder = 'static'
return render_template("s&p500.html")
# Running the app
if __name__ == '__main__':
app.run(debug = True)