From the course: Data Ingestion with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Location from IP

Challenge: Location from IP - Python Tutorial

From the course: Data Ingestion with Python

Start my 1-month free trial

Challenge: Location from IP

(upbeat electronic music) - [Narrator] For this challenge, you will need to download some information first. Use the download.py script for this. Python, download.py. This is going to take awhile. Once the script finished, you'll have two extra files in this directory. One of them, is a NASA access log file. It's contains lines. Each line is prefixed either by an IP address, or by an actual host link. You'd like to get the user location from the IP address. There are several such services. We're going to run a small GeoIP server of our own. It's around the geoip.py file, that you have in the Exercise Files. Python, geoip.py. And wait a bit, until you see the server ready prompt. Your task is to go over the first one thousand lines in the NASA log file that have valid IP in them. And generate a report that will show the five countries that have the most visits to the website. For each country, show it's…

Contents