Example #1
0
def _get_price_history_small(index, start, end, proxies = {}):
    
    if type(start) == type(datetime.date(2000,1,1)):
        start = date_to_str(start)
    if type(end) == type(datetime.date(2000,1,1)):
        end = date_to_str(end)
    url = PRICE_HISTORY%(index.upper().replace(' ','%20'), start, end)
    resp = req.get(url = url, proxies = proxies)
    rows = html_to_rows(resp.text)
    return _html_to_index_df(rows)
Example #2
0
def _get_price_history_small(index, start, end, proxies = {}):
    
    if type(start) == type(datetime.date(2000,1,1)):
        start = date_to_str(start)
    if type(end) == type(datetime.date(2000,1,1)):
        end = date_to_str(end)
    url = PRICE_HISTORY%(index.upper().replace(' ','%20'), start, end)
    resp = req.get(url = url, proxies = proxies)
    rows = html_to_rows(resp.text)
    return _html_to_index_df(rows)
Example #3
0
def get_price_list(dt, proxies={}):
    dt_str = date_to_str(dt, style='ddMMMyyyy')
    yy = dt_str[5:9]
    mm = dt_str[2:5].upper()
    url = PRICE_LIST_URL % (yy, mm, dt_str.upper())
    resp = req.get(url=url, proxies=proxies)
    df = pd.read_csv(StringIO(unicode(__raw_zip_data_to_str(resp.content))))
    del df['Unnamed: 15']
    return df
Example #4
0
def get_price_list(dt, proxies={}):
    dt_str = date_to_str(dt, style="ddMMMyyyy")
    yy = dt_str[5:9]
    mm = dt_str[2:5].upper()
    url = PRICE_LIST_URL % (yy, mm, dt_str.upper())
    resp = req.get(url=url, proxies=proxies)
    df = pd.read_csv(StringIO(unicode(__raw_zip_data_to_str(resp.content))))
    del df["Unnamed: 15"]
    return df