Skip to content

Kirollos-Hanna/logs-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Description

The program uses python and psycopg2 to make queries to an SQL database and outputs the results in a simple text file. The queries include joining multiple tables to get the desired information and is presented in an easy to read format for interested readers.

Requirements

How to run

  • Download the news database
  • cd into the project directory.
  • unzip the news database in the directory.
  • run the command psql -d news -f newsdata.sql. (Make sure to download all the required software for this to work)
  • use the python or python3 command with the logsanalysis.py file from your command line. (i.e. python logsanalysis.py)
  • The program will run for a while and will output the results into the output.txt file. (nothing will be output in the command line)

How it works

  • The program first connects to the news database and creates a cursor.
  • It then performs three queries, namely:
    1. Finding the three most popular articles.
    2. Listing the most popular authors by article page views.
    3. Finding the days where more than 1% of requests to the website led to errors.
  • The query results are then saved into strings and appended into the output.txt file.

About

Udacity's logs analysis project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages