def get_available_datasets():
"""
Get the list of datasets available from the Fama/French data library.
Returns
-------
A list of valid inputs for get_data_famafrench.
"""
try:
from lxml.html import parse
except ImportError:
raise ImportError("Please install lxml if you want to use the "
"get_datasets_famafrench function")
root = parse(_URL + 'data_library.html')
l = filter(lambda x: x.startswith(_URL_PREFIX) and x.endswith(_URL_SUFFIX),
[e.attrib['href'] for e in root.findall('.//a') if 'href' in e.attrib])
return lmap(lambda x: x[len(_URL_PREFIX):-len(_URL_SUFFIX)], l)
评论列表
文章目录