コード例 #1
0
from datetime import timedelta
import datetime
from bokeh.models import Range1d
import matplotlib.pyplot as plt


logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

warnings.simplefilter(action='ignore', category=FutureWarning)

plt.switch_backend('agg')


app = FlaskAPI(__name__)
app.args = {}

api_url = 'https://www.isyatirim.com.tr/_Layouts/15/IsYatirim.Website/Common/ChartData.aspx/IndexHistoricalAll?period=1440&from=%s000000&to=%s235959&endeks=%s.E.BIST'


@app.route('/', methods=['GET'])
def home():
    return render_template('index.html')


@app.route('/stock-names', methods=['GET'])
def stock_names():
    search = request.args.get('search')
    with open(os.path.join('.', 'data', 'stock_names.json')) as f:
        names = json.load(f)
    if search: