You’ve been writing some great code, but you really need to get out more. There’s a whole world of data just waiting for you on the web: Need weather data? Or how about access to a huge database of recipes? Or are sports scores more your thing? Maybe a music database of artists, albums, and songs? They’re all out there for the taking from Web APIs. To use them all you need is to learn a bit more about how the web works, how to speak the local web lingo, and how to use a couple of new Python modules:
json. In this chapter we’re going to explore Web APIs and take your Python skills to new heights; in fact, we’re going to take them all the way to outer space and back.
You think we’re kidding!
You’ve seen a recurring pattern in this book: first you took your code and abstracted it away into functions. Once you did that, you could make use of the functionality in a function without having to worry about all the details of how the function does what it does. This allowed you to elevate your thinking above the level of simple statements.
Next you packaged things up into modules that contained a whole set of functions and values. Remember the code you handed to Cory? He was able to quickly look at your documentation, see what functions were available, and make use of ...