一个简单的欧盟统计局rest api客户端
eurostatapiclient的Python项目详细描述
欧盟统计局api客户端(python)
使用欧盟统计局api客户端从欧盟统计局rest服务快速检索json数据,并将其转换为pandas数据帧。可以找到服务的简单描述here
安装
使用pip安装欧盟统计局api客户端。
pip install eurostatapiclient
快速启动
此示例显示如何从中检索数据集和pandas数据帧。
fromeurostatapiclientimportEurostatAPIClient# Choose service version : only v2.1 is currently availableVERSION='v2.1'# Only json is currently availableFORMAT='json'# Specify language : en, fr, deLANGUAGE='en'client=EurostatAPIClient(VERSION,FORMAT,LANGUAGE)dataset=client.get_dataset('tps00001')print(dataset.label)dataframe=dataset.to_dataframe()print(dataframe.head())# Add some filters (only mono-filtering is available for now)params={'geo':'DE',}filtered_dataset=client.get_dataset('tps00001',params=params)filtered_dataframe=filtered_dataset.to_dataframe()print(filtered_dataframe.head())
贡献
欢迎投稿!
请随意在“问题”部分中建议修改/增强,或创建拉取请求