worldbank / dec-python-course

14 stars 5 forks source link

Session 4 - APIs and intro to data visualization #7

Closed luisesanmartin closed 2 years ago

luisesanmartin commented 2 years ago

Some notes:

weilu commented 2 years ago

@luisesanmartin I've reviewed the slides and the notebook on APIs. It's looking good.

I think the API section is missing introduction of fundamental concepts such as: What's HTTP? including different part of an URL: protocol (http vs https), domain, path, query params. Then there's HTTP request and HTTP response. For example http requests can be made independent from any programming language or any package – perhaps demo making an HTTP request from the browser (like you did in the slides) and/or curl, or postman. In covering requests perhaps also consider explaining a bit of the relevant HTTP request headers, e.g. Content-Type, Accept, different requests methods – most notably GET and POST which are likely the two they might use for data fetching; then with POST it might be natural to introduce request payload and some common formats like JSON and/or XML, which also can be used for response payload. Then in covering HTTP responses, it might be useful to talk about a few common response status codes, 200, 404, 403, 429, 500 etc

I believe these are important concepts to introduce as they are fundamental to interacting with the internet programmatically. They are also programming language independent and library/package independent. The material doesn't need to be comprehensive but should be sufficient to give the audience the power and knowledge of the proper terms which they can understand (e.g. in documentations) and use later when they apply it in exercises and projects.

Other comments:

luisesanmartin commented 2 years ago

@weilu thanks a lot for the review, you include lots of thoughts and a perspective that had not occurred to me. I included some of your suggestions but not all. In general, I think explaining more about HTTP adds complexity for the session that is not strictly necessary for an introduction of how to work with APIs. I did include more content and an explanation about requests and responses that makes how to use requests and the response object type clearer.

In data vis, my idea for the session is that it should be more of a live demonstration than a "lecture" type like APIs is, so I'm not including exercises in the session. I'm thinking this because APIs (and the concepts introduced in previous sessions) are probably quite new for participants while data vis might be more familiar for them. Still, I think this is already a lot to cover in one session and I'm thinking of giving more importance and time to APIs.

luisesanmartin commented 2 years ago

let me know if you have any thoughts, I'm adding the exercise solutions for the APIs part tomorrow