FSND Project1 - Logs Analysis
This is a command line reporting tool that connects to the database of a newspaper website and provides insights derived from users activity.
Questions answered by the program:
- What are the most popular three articles of all time?
- What are the most popular article authors of all time?
- On which days did more than 1% of requests lead to errors?
-
Set-up a virtual machine using Vagrant and VirtualBox.
- install VirtualBox package for your operating system.
- install Vagrant package for your operating system.
- download the FSND Virtual Machine folder and
cd
into the "vagrant" subdirectory. - run
vagrant up
to download the Linux operating system and install it. - run
vagrant ssh
to log in to your installed Linux vertual machine. - click here for more detailed instructions (course enrollment required).
-
download and unzip newsdata.sql into "vagrant" directory. This file contains the database design (tables), and data for each table.
-
set up the local database "news", and load data into it using the command
psql -d news -f newsdata.sql
-
add the necessary views in "create_views.sql" using the command
psql -d news -f create_views.sql
-
run the python file from the command line
python3 report.py
and you will see the answers to the questions as in "output.txt" file.