opus-42 / eurostat-api-client Goto Github PK
View Code? Open in Web Editor NEWA simple python client to query eurostat API
License: Apache License 2.0
A simple python client to query eurostat API
License: Apache License 2.0
Hello,
Thanks for this very useful function.
I tried to use it with the following specification. It works for Germany, but not for Italy or France. For the two latter countries, the data do not seem to be in the right order.
Thanks
client = EurostatAPIClient(VERSION, FORMAT, LANGUAGE)
params = {'unit':'I15','geo': 'FR','coicop':'CP00'}
hicp_d = client.get_dataset('prc_hicp_midx',params=params)
hicp = hicp_d.to_dataframe()
hicp.plot()
Hello @opus-42 ,
I recently visited the Eurostat website and saw the following warning message:
Apparently, the current API will be deprecated by January 2023, as they are migrating to a new one. Thankfully, Eurostat posted a migration guide that includes all the differences between the two APIs, available here. I suggest updating the library code so it remains functional when the REST API is phased out, thank you.
Giannis Tolios
Thanks a lot for this simple client!
I was wondering if there's a simple way to get a dict of f.ex nace_r2 codes, similar to f.ex using this client
import eurostat
eurostat.get_dic('nace_r2')
Best
Hi Emmanuel,
I have been using this package for a while, and until now everything went well. Now I have got an error :
unboundlocalerror: local variable 'updated' referenced before assignment
In the dataset.py file, there is a create_json_function where the error comes from. If I add a new line "updated = datetime.now()" at the top of the function, it works, but it always gives back the datetime.now() so the problem can be here:
updated_raw = json.get("updated") date_regex = re.compile(r'\d{4}-\d{1,2}-\d{1,2}') if updated_raw and date_regex.match(updated_raw): updated = datetime.strptime( updated_raw, '%Y-%m-%d' ) else: datetime.now()
I think the Eurostat website has changed and this causes the problem. I am trying to figure it out what has changed, but it takes time because I'm not familiar with the Eurostat website.
Sorting keys that are strings yields in the following:
"1", "12", "2", "3", "4".
One need first to convert to integer and then sort to assure dataset values are stored in the correct order.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.