GithubHelp home page GithubHelp logo

mattbingham / udacity_logs-analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7 KB

Udacity logs analysis project for the Full Stack Developer Nanodegree.

Python 100.00%
udacity-nanodegree-project python3

udacity_logs-analysis's Introduction

Logs Analysis Project

This project is part of the Udacity Full Stack Developer Nanodegree. The goal is to create a python file that fetches a defined set of results (goals) when executed.

Goals

  1. Display the most popular three articles of all time, sorted by most popular first
  2. Display the most popular authors of all time, sorted by the most popular first
  3. Display which days requests which lead to errors is more than 1%

Database information

  • The database name is named news

Tables / Columns of news database

articles
author int
title text
slug text
lead text
body text
time timestamp tz
id int
authors
name text
bio text
id int
log
path text
ip inet
method text
status text
time timestamp tz
id int

Instructions

This project requires a database and vagrant box supplied by Udacity when participating in this project.

Required files

  1. The vagrant box template is available here.
  2. The newsdata.zip file is available here.
  3. You'll also need to install the psycopg2 module.

Set-up

  1. Extract the vagrant box folder
  2. Extract newsdata.sql inside the vagrant folder
  3. cd into the vagrant folder
  4. Start the Vagrant box: Run vagrant up (this will begin the box download, which may take a while depending on the speed of your internet connection)
  5. Install psycopg2 for Python3
  6. Install the database: (Still inside the vagrant folder) run psql -d news -f newsdata.sql

Run the program

  • Run python logsanalysis.py in bash (or python3 logsanalysis.py if you have both Python2 and 3 installed).

Goals passing (output)

  1. Python file is PEP-8 checked

  2. The most popular 3 articles of all time are:

Candidate is jerk, alleges rival - 338647 views
Bears love berries, alleges bear - 253801 views
Bad things gone, say good people - 170098 views
  1. The most popular authors of all time are:
Ursula La Multa - 507594 views
Rudolf von Treppenwitz - 423457 views
Anonymous Contributor - 170098 views
Markoff Chaney - 84557 views
  1. Days on which more than 1% of the requests lead to errors:
2016-07-17 - 2.3% errors

udacity_logs-analysis's People

Contributors

mattbingham avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.