In this lesson today, we will be practicing more on how we can collect data from APIs.

Objectives For Today

  • APIs and Geospatial Data Visualization

Context

Today’s lesson is about visualizing a real-world phenomenon: banking deserts.

What is a banking desert?

In predominantly lower-income or elderly neighborhoods, there is often a dearth of banks.

Often, high-interest “check-cashing” and “money transfer” providers are in their place. These shifty providers benefit from the fact that banks avoid such neighborhoods, leaving residents with few safe options to obtain cash, loans, or withdrawal services.

Today, we will showcase this trend with a dataset from the US Census.

Before we begin the class

We will need to install the following Python libraries with the following commands:

  • Activate your conda dev virtual environment: conda activate dev
    • Because if you don’t activate your dev virtual environment, any installation will go to the default environment and it will not work for your Jupyter notebook.
    • This is an example of having different environments for different projects, and it is a common practice to do so.
  • Install the following libraries using these commands:
	conda install -c pyviz hvplot geoviews
	pip install census
	pip install citipy # not needed for the class but needed for the challenge
  • Ensure that these libraries are installed properly by running the following commands:
	conda list hvplot
	conda list geoviews
  • If you do not see anything listed when you check the geoviews library, try an alternative install option such as:
	conda install -c conda-forge geoviews

We also need to register our personal keys from the Geo Views API here by registering for an account: https://www.geoapify.com/

  • The API keys in the activities are deprecated. We need to replace those keys with our personal keys.
  • After registering, create a project and test out your key.

Purpose of this lesson

In reality, the previous lessons lay down the foundations of how you can extract data from different sources for analysis.

Remember in the first lesson I mentioned that data is like a TV box without the channels? Data itself is a medium.

To excel in data, we will need to dive deep into the relevant types of data in the specific industry that you want.

Geoapify Geocode

Let’s open up the file(s) in the 01-Ins_Geoapify_Geocode folder to get started.

We can also use Geoapify’s playground to visualize their maps: https://apidocs.geoapify.com/playground/geocoding/

Geoapify Places

Let’s open up the file(s) in the 02-Ins_Geoapify_Places folder to get started.

Geoapify has a comprehensive API here: https://apidocs.geoapify.com/docs/places/#about

Students Do: Geoapify Drills

Exploring Nearest Restaurants in Madrid

Let’s open up the file(s) in the 04-Ins_Nearest-Restaurants folder to get started.

Exploring Airports in Australia

Let’s open up the file(s) in the 05-Evr_Exploring_Airports folder to get started.

GeoViews Maps

Let’s open up the file(s) in the 06-Evr_Geoviews_Maps folder to get started.

Student Do: Australian Airports Map

U.S. Census Demo

Look at the file(s) in the 08-Ins_Census folder.

Banking Deserts