An internal reporting tool that prints out reports (in plain text) based on the data in the database of newspaper site. This reporting tool is a Python program using the psycopg2 module to connect to the database.
It is designed to answer 3 questions from database:
$ python log_analysis.py
1. What are the most popular three articles of all time?
"Candidate is jerk, alleges rival" — 338647 views
"Bears love berries, alleges bear" — 253801 views
"Bad things gone, say good people" — 170098 views
2. Who are the most popular article authors of all time?
Ursula La Multa — 507594 views
Rudolf von Treppenwitz — 423457 views
Anonymous Contributor — 170098 views
Markoff Chaney — 84557 views
3. On which days did more than 1% of requests lead to errors?
Jul 17, 2016 — 2.26%
cd
the project directory then run:
echo 'CREATE DATABASE news;' | psql; unzip -p newsdata.zip | psql news;
Note: This project runs on any of Python2 & Python3