Activities: Week 10

Problem Set

Note

Reminder: we do not debug code when grading, and we do not grade code that does not run! Make sure your code runs completely before submitting it, so you see all the test output! You should comment out any code that does not run.

There are 4 files to download for this problem set:

In this problem set, you’ll build on the skills you practiced in Problem Set 6. You will:

  • Open JSON-formatted files and load the data in them into Python objects
  • Deal with nested dictionaries to extract information
  • Set up a caching pattern for your file
  • Write a function that gets data from Flickr which depends upon the function’s input, and caches new data
  • Extracts information from data you get from the Flickr API

Follow the instructions in the file – make sure to read them carefully, as they provide hints and help for what to do for each problem.

There is also a challenge provided at the end of the problem set file!

To complete the challenge, if you wish to, you’ll need to do a little bit more data processing and write one more function that caches data/gets data from a cache.

Check out the Flickr Photo Info API documentation – you’ll need to make requests to this Flickr API endpoint to complete it!

(Hint: if you want each of the tags from each photo, you’ll have to make a request to THIS API endpoint with, say, the id of the photo you want data about…)

We will discuss the challenge in more detail later on in class.

Next Section - Activities: Week 11