read_datajson.py 文件源码

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

项目:series-tiempo-ar-api 作者: datosgobar 项目源码 文件源码
def handle(self, *args, **options):
        url = options['url']
        name = options['name']
        if url or name:
            if not name or not url:
                raise CommandError(MISSING_ARG_MSG)
            index_catalog(DataJson(url), name)
            return

        catalogs = yaml.load(requests.get(CATALOGS_INDEX).text)

        for catalog_id, values in catalogs.items():
            if values['federado'] and values['formato'] == 'json':
                try:
                    catalog = DataJson(values['url'])
                except (IOError, ValueError) as e:
                    logging.warn(READ_ERROR, catalog_id, e)
                    continue

                index_catalog(catalog, catalog_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号