一个来自api.kolada.se/v2的统计数据的刮刀,建立在statscaper之上。
kolada_scraper的Python项目详细描述
这是一个来自http://api.kolada.se/v2/的统计数据刮刀,它构建在statscaper包的顶部<;https://github.com/jplusplus/statscaper>;。
安装
pip install -r requirements.txt
示例用法
fromkoladaimportKoladaScraperscraper=KoladaScraper()dataset=scraper.items["N00002"]# pass a KPI id# Query by yeardata=dataset.fetch({'period':[2016,2015],})# ...or by municipalitytowns=[x.valueforxindataset.dimensions['municipality'].allowed_values]data=dataset.fetch({'municipality':towns[:5],})# ... or by bothdata=dataset.fetch({'period':[2016,2015],'municipality':towns[:5],})# And then do something with the results.print(data.pandas)
待办事项
- 添加更多允许值
- 传递不允许的值时实现错误
- 实施地区
- updatechunkify()函数,以便更好地构建url