The LogAnalyzer script queries a database containing 'authors', 'articles', and 'log' tables and prints answers to the following questions:
- What are the three most popular 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?
- Python 3.5.3
- psycopg2
- Postgresql 9.5.8
- Make sure you have requirements listed above installed.
- Create the
news
Postgres database by running:
$ createdb news
- Download the data here and unzip it to extract the
newsdata.sql
file. - Load the data into the database with:
$ psql -d news -f newsdata.sql
From the root of this project, run:
$ python3 LogAnalyzer.py
You should see the output contained in output.txt in your terminal.