api.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:dbcollection 作者: dbcollection 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号