Skip to content

Optional Project Exercise 1 from Udacity Full Stack Nanodegree

Notifications You must be signed in to change notification settings

MANOJPATRA1991/PUPPY-SHELTERS-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PUPPY-SHELTERS

Introduction

This is an optional project completed as part of Part 3 The Backend: Databases & Applications of Udacity Full Stack Nanodegree course.

Table of Contents

  1. Installation
  2. Description
  3. Reference
  4. License

Installation

NOTE:

This project was built on Windows 10 OS. All the interaction with the Virtual Machine was done through Command Prompt on Windows.

(Do not use Git Bash for this project. It simply won't work.)

  1. Python

The source code for this project is written in Python v3.6.1 programming language. For direct download of version 3.6.1 click here.

  1. Code Validators

The source code was checked against bugs and quality using Pylint tool, PEP8 tool and PEP8 online check.

To install Pylint:

pip3 install pylint

To check Python file using Pylint:

pylint fileName.py

To install pep8:

pip3 install pep8

To check Python file using pep8:

pep8 fileName.py
  1. Virtual Box

To run the Virtual Machine, first, we need to download it and then install it. Virtual Box can be downloaded from here.

  1. Vagrant

Vagrant is the software that configures the VM and lets you share files between your host computer and the VM's filesystem. Vagrant can be downloaded from here.

  1. psycopg2 python module is required. To install:
pip3 install psycopg2
  1. SQLAlchemy

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. For instructions on download and installation click here.

Description

Design a database server to keep track of puppies used by the sheltes for adoption.

Exercise Requirements

Using SQLAlchemy perform the following queries on your database:

  1. Query all of the puppies and return the results in ascending alphabetical order
  2. Query all of the puppies that are less than 6 months old organized by the youngest first
  3. Query all puppies by ascending weight
  4. Query all puppies grouped by the shelter in which they are staying
Executing the program
  1. Create a new folder.

  2. If the folder doesn't already contain a Vagrantfile. Run the following command to create one.

vagrant init
  1. To start the virtual machine, from your local directory, run the following command:
vagrant up
  1. Then to drop a full-fledged SSH session, run the following command:
vagrant ssh
  1. Download and run database_setup.py file to create the database.

  2. Download and run puppypopulator.py file to populate your database with puppies and shelters.

  3. Download and run the puppy_query.py file to do queries.

Reference

  1. Python Documentation
  2. Google Python Style Guide
  3. PEP8
  4. Vagrant
  5. Oracle VM Virtual Box
  6. PostgreSQL
  7. SQLAlchemy

License

The content of this repository is licensed under MIT.