Andela Bootcamp Day 2

So here I was on the second day of bootcamp having beat the first deadline the previous day n felt quite confident. But this did not last long as i discovered the exercises were just getting tougher. One of the major challenges for day 2 was to create a simple command line interface program to consume a public api. It seemed I had a lot to learn that day as I had no idea how to implement it.

I studied on how apis work and got to understand that they respond to various requests with a distinct response. The response in usually either a JSON or XML type response and you can use it to display the required data from the API. This opened a whole lot of possibilities as there are countless public API’s that would provide almost all of the data and funtions I would possibly think of.

In my case I used the urllib and json modules in python to consume a google maps api to return the longitude and latitude of a given location given as an argument to the function. It worked perfectly and it felt awesome to have such power using a simple library in python. Damn! I love python.