Example #1
0
from flask import Flask, render_template, request, redirect, Markup
from bokeh.plotting import figure, output_file, show  # standard bokeh import
from bokeh.models import Range1d, BoxAnnotation
from bokeh.embed import components
import time
import datetime
import requests
import simplejson as json
import numpy as np
import pandas as pd

app = Flask(__name__)

app.script = ""
app.div = ""


@app.route("/")
def main():
    return redirect("/index")


@app.route("/index", methods=["GET", "POST"])
def index():
    if request.method == "GET":
        app.script = ""
        app.div = ""
        app.stock_symbol = ""
        app.stock_name = ""
        app.closing_price = ""
        app.volume = ""
Example #2
0
from bokeh.plotting import figure
from bokeh.embed import components
import Quandl
import time
import datetime

app_lulu = Flask(__name__)

app_lulu.colors = {"Black": "#000000", "Red": "#FF0000", "Green": "#00FF00", "Blue": "#0000FF"}
app_lulu.colorlist = ["Black", "Red", "Green", "Blue"]

# global variables list 12345786
app_lulu.vars = {}
app_lulu.stock_data = []
app_lulu.err_msg = ""
app_lulu.script = ""
app_lulu.div = ""
app_lulu.price_cnt = 0
app_lulu.time_delta = datetime.timedelta(days=-31)


@app_lulu.route("/")
def main_entry():
    return redirect("/main_input")


@app_lulu.route("/main_input", methods=["GET", "POST"])
def main_input():
    if request.method == "GET":
        return render_template("user_input_page.html")
    else: