from flask import render_template, Blueprint

import requests
import time
from datetime import datetime, timedelta
import ezodf
from ezodf import newdoc, Sheet
import decimal
from decimal import Decimal
from decimal import getcontext


# The following should be moved to the .cfg file
_TIINGO_flag = True

_TIINGO_KEY = '7dccb22a99e2e290a405c363117ea61a207e0662'
_TIINGO_url = 'https://api.tiingo.com/tiingo/daily/{}/prices'
_TIINGO_url_iex = 'https://api.tiingo.com/iex/{}'
_TIINGO_headers = {
    'Authorization': 'Token ' + _TIINGO_KEY,
    'Content-Type': 'application/json',
}

url = _TIINGO_url_iex.format('MMM')
r = requests.get(url, headers=_TIINGO_headers)

print('***Debug***', r.status)

