This is a reporting project for a newspaper site, with the database behind it. The exact task is to generate following three reports:
- The most popular three articles of all time
- The most popular article authors of all time
- Days when more than 1% of requests lead to errors
File | Comment |
---|---|
logs-analysis.py | python code |
Vagrantfile | Vagrant configuration file |
README.md | this file |
output.txt | expected run output |
Software | Version | Download |
---|---|---|
Python | 3.6.6 | link |
VirtualBox | 5.2.16 | link |
Vagrant | 2.1.2 | link |
-
Download database from this link
-
Start virtual machine with command:
-
Connect to virtial machine with command:
-
Move to the working directory:
-
Load data with command:
-
Check the database includes following three tables:
Table | Content |
---|---|
authors | information about the authors of articles |
articles | the news articles |
log | includes one entry for each time a user has accessed the site |
-
In PSQL prompt execute following SQL command to create the first helper view:
-
In PSQL prompt execute following SQL command to create a second helper view:
-
Run the project code by executing following command on operting system prompt:
-
Compare the output with the content of output.txt file.