Logs Analysis is a reporting tool that prints out reports (in plain text) based on the data in the database. This reporting tool is a Python program using the psycopg2 module to connect to the database.
This project assumes you have psycopg2
library and news
database installed.
- If not, follow along otherwise skip to step 2.
- Install psycopg2 using
$ pip install psycopg2
- Download data for news database here
- Extract newsdata.sql and cd into that directory in terminal.
- Run following command in terminal
$ psql -d news -f newsdata.sql
- Install psycopg2 using
- Open the Logs Analsis folder containing logsAnalysis.py in terminal.
- Run the following command to obtain required results:
$ python logsAnalysis.py
$ python logsAnalysis.py
The most popular articles are as follows:
- Candidate is jerk, alleges rival - 338647 views
- Bears love berries, alleges bear - 253801 views
- Bad things gone, say good people - 170098 views
Authors Poularity:
- Ursula La Multa - 507594
- Rudolf von Treppenwitz - 423457
- Anonymous Contributor - 170098
- Markoff Chaney - 84557
Failed requests more than 1 percent of total request on following days:
- 2016-07-17 - 2.26%