A simple Eurostat Rest API client
Project description
Eurostat API Client (Python)
Use the Eurostat API Client to quickly retrieve json data from Eurostat REST service in a convenient format. A simple description of the service can be found here
Installation
Install Eurostat API Client using pip.
pip install eurostat-api-client
Quick start
This example shows how to retrieve a dataset and a pandas dataframe from it.
from eurostatapiclient import EurostatAPIClient
# Choose service version : only v2.1 is currently available
VERSION = 'v2.1'
# Only json is currently available
FORMAT = 'json'
# Specify language : en, fr, de
LANGUAGE = '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())
Contributions
Contribution are welcome !
Feel free to suggest modifications/enhancements in the issue section, or to create a pull request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for eurostatapiclient-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a81a30a6f80f64c679b8883a97743b89117c864e918b3dfdd98c8bb6850f6ef8 |
|
MD5 | 8b889bf4a9ea1590566d22f69ede6633 |
|
BLAKE2b-256 | b74b7e2826885daa392311b4a0d116619bd1e2ad4fa2c6b720e968b58e66ae43 |