1. Introduction
  2. Simple Types
  3. Lists
  4. Sorting
  5. Dicts
  6. Files
  7. Fetching Data from the Internet
  8. Simple Data Analysis
  9. Exercises
    1. Basic exercises
    2. OS Names API
    3. Life expectancy tables
    4. Copy special
    5. Log puzzle

OS Names API

Note: these exercises expect that you have registered for a user account and acquired an API key, and that you have saved that key in a secrets.py file in dict called secrets with at least a member key with the value of that API Key. That file must be in the working directory where the rest of your code is.

Part 1 - Local Type

Taking the file get_names.py as a starting point add functionality to extend the programs behaviour to take a LOCAL_TYPE to restrict the results by passing in a fq parameter as described in the technical specification.

Part 2 - Local Types

Now modify your program to handle more than one LOCAL_TYPE at a time.

Part 3 - Limit by Type

The results include a field TYPE but for some reason it isn’t possible to limit API results by that value. See if you can extend your last program to allow a user to limit their request by TYPE such as populatedPlace.

Solutions

If you get completely stumped here are the solutions for you to try and decipher.