This reporting tool is a Python program with PostgreSQL database to print out reports based on the data given from news database.
- What are the most popular three articles of all time?
- Who are the most popular article authors of all time?
- On which days did more than 1% of requests lead to errors?
To get started, I recommend you to download Vagrant, VirtualBox and VM configuration from links given below,
- Download Vagrant
- Download VirtualBox
- Download VM configuration FSND-Virtual-Machine.zip
TO INSTALL AND MANAGE THE PROGRAM USING VIRTUAL MACHINE
-
Go to VM configuration folder
-
Change to this directory in your terminal with
cd
-
Use
vagrant up
to bring the virtual machine online andvagrant ssh
to login. -
Download the database provided by Udacity from here.
-
Unzip the file in inside the vagrant folder.
-
Change to vagrant directory in your terminal with
cd /vagrant/
-
Load the database using
psql -d news -f newsdata.sql
. -
Connect to the database using
psql -d news
. -
Create the Views given below.
Then exit psql
. -
Now execute the Python file -
python logs_analysis.py
Otherwise download python 2.7 and PostgreSQL to run this program.
CREATE VIEW articles_view AS select id,title,slug,author from articles;
CREATE VIEW log_view as select path,count('*') as views_count from log group by path