Skip to content

Assignment 9 - #5

Open
kfbmartin wants to merge 73 commits into
mainfrom
assignment-9
Open

kfbmartin wants to merge 73 commits into
mainfrom
assignment-9

Conversation

@kfbmartin

Copy link
Copy Markdown
Owner

Mke a GET request with requests.get() and parse the JSON response.
Read API documentation, construct a request with query parameters, and handle common HTTP status codes.
Navigate nested JSON and build a clean list of dictionaries from raw API response data.

kfbmartin added 30 commits July 13, 2026 19:46
…railing spaces in warmup1, and updating warmup2 to a list of strings
kfbmartin added 28 commits August 25, 2026 10:34
@emorenov

Copy link
Copy Markdown

Revisions:

Mini-project is using the wrong API and data shape for this assignment. The instructions require fetching from https://restcountries.com/v3.1/all?fields=name,capital,region,population and then parsing each country into a list of dictionaries with the keys name, capital, region, and population. Your mini_project.py uses a different endpoint, different field names, and an API key/header setup that is not part of the assignment. Because of that, the script does not match the required data structure.

  • [Correction] Disregard. Previous API version 3 has been replaced with version 5 utilizing an API Key.

Search by name does not follow the required behavior. The assignment asks for a case-insensitive partial match against country names. Your current option 1 sends the search term to the API instead of filtering the already-fetched list locally, so it does not implement the requested search flow.

  • [Correction] Disregard. Current implementation stores a list of countries in a list first, then searches for match by using the "in" keyword as seen in line 79

@emorenov

emorenov commented Sep 15, 2026

Copy link
Copy Markdown

Revisions:

Filter by region needs to use the fetched list and sort by population. The assignment expects you to filter countries already loaded at startup, then print the matching countries in descending population order. Your current code again relies on request parameters instead of local filtering, so it does not satisfy the mini-project requirements.

  • [Correction] Disregard. The current implementation stores the countries first, the filters by region name, and lastly sorts by population.

Capital handling should match the expected field name. The assignment expects a single capital value and to display N/A when it is missing. In your cleaned data you use capitals, which makes the output structure differ from the instructions.

  • [Correction] Disregard. In your code, you are only showing one capital at the end of the print statement. Since you are only getting 1 capital name, using the singular 'capital' wording is fine. If you were to print the entire list of capitals then it would make more sense to use the plural form 'capitals'. This is a minor detail, but it's fine as is.

Great Jobs! This looks pretty good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants