This project uses the REST Countries API to create a database of all the countries around the world. The database is linked to a GUI front-end that allows users to select how they want to view the data of the countries. The users can also choose if they want to view the countries worldwide or by any of the 7 continents. For example, the user can choose to compare the top five countries by population in Europe, or any nine countries in worldwide by area. Or the user can choose four specific countries in south America to view general information about them.
General information for each country includes:
This repo consists of the following files:
tour_de_world.py
is the main file to run the programbackend.py
has the API call and the code to create the database from the resulting JSON download. Running this file creates countries.db
, a sqlite database of the countries data from the APIfrontend.py
has the GUI front end to navigate and display the data using TKinter. This file relies on the existence of countries.db
in the same directoryCODEOWNERS
specifies the authors of the program who have permission to modify the code in this repoLICENSE
provides licensing information.The program requires that Python and some additional packages already be installed on your local machine.
Tour de World uses some packages that are not part of the Python standard library. If you have installed Python using Anaconda, you already have these packages. You are done with the prerequesites and can move on to Section 2.
If you have installed Python without using Anaconda, such as directly from python.org, you will need to install the additional packages. Open a command line prompt such as Terminal or PowerShell. Type the following commands at the prompt. Depending on your installation, you many need to substitute python3
for python
.
python -m pip install -U pip
. This installs the latest version of pip, the Python Package Installer that allows the installation of the other required packagespython -m pip install -U requests
. This installs requests, a library that allows Python programs to access web pages and API request via HTTPpython -m pip install -U matplotlib
. Matplotlib enables the creation of plots, charts, and other visualizations in Python. Installing matplotlib also automatically installs numpy, the gold standard for scientific calculations in python. Tour de World requires numpy.Download and intall this entire repo to your local machine.
cd <path/to/unzipped_folder>
(Mac/Linux) or cd <path\to\unzipped_folder>
(Windows)python tour_de_world.py
or python3 tour_de_world.py
as appropriate for your system.This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/.