def fetch_list_datasets():
"""Get all datasets into a dictionary.
Returns
-------
dict
A dictionary where keys are names of datasets and values are
a dictionary containing information like urls or keywords of
a dataset.
"""
db_list = {}
for _, modname, ispkg in pkgutil.walk_packages(path=datasets.__path__,
prefix=datasets.__name__ + '.',
onerror=lambda x: None):
if ispkg:
paths = modname.split('.')
db = get_dataset_attributes(modname)
if db:
dbname = paths[-1]
db_list.update({dbname: db})
return db_list
评论列表
文章目录