Final Project: Contacts
CSE/IT 107L
NMT Department of Computer Science and Engineering
Contents
1 The Problem 1
1.1 Example Session…………………………………. 1
2 Assignment 1
2.1 Design……………………………………… 1
2.2 README…………………………………….. 2
2.3 Contacts Format…………………………………. 2
2.4 Application Commands…………………………….. 2
2.5 Extra Credit…………………………………… 4
3 Submitting 5
Grading
60% Code Implementation
10% Design
10% Readme
10% Docstring Comments
05% Code follows PEP 8 and PEP 257 style guides
05% Tarball is named correctly. i.e.cse107_firstname_lastname_contacts.tar.gz
1 The Problem
1 | You are an employee of NMTLabs, a small software consultation firm for noble gas mass spec-trometry. At this week’s developer meeting you were tasked with developing an application to manage the firm’s contacts. The CEO and CTO of NMTLabs are looking for something that is text-based and easy to use, so the firm can quickly start calling contacts for the latest round of venture capital fundraising. Heretofore the firm has been using a simple CSV file to save all of its contacts. Everyone in the organization is looking for an improved solution and are counting on |
1.1 Example Session
An example session using the application is shown below. A user starts the application, enters the commands, about, info, list and finally exit. The application displays a farewell message and quits.
Note line 1 is a terminal command.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
181 $ python3 contacts.py
2 Welcome to the Contact application
3 Please enter a command: about
4 Contacts App. Developed by Jake Ross for CSE107 2015
5
6 Please enter a command: info
7 contacts path: contacts.txt
8 number contacts: 3
9
10 Please enter a command: list
11 Name : Phone Company email
12 -----------------------------------------------
13 Elon Musk : 453-6723 SpaceX emusk@spacex.com
14 Larry Page : 853-0653 Google lpage@gmail.com
15 Tim Cook : 133-0419 Apple tcook@apple.com
16
17 Please enter a command: exit
18 Goodbye
2 Assignment
1 | Make your clean and readable. You will be graded on style and functionality. You must follow |
2.1 Design
1 | Provide a description of how you plan to solve this problem. Draw figures, flowcharts, and tables |
- The application starts.
- The user wants to add a contact.
- The program sequentially asks for required information validating each inputted value.
- The program adds contact to its stored contacts.
- The added contact information is displayed to the user.
2.2 README
1 | Write aREADME.txtfile. This is common practice in the open source community and provides a consistent location for users to find introductory information about your application. This file should contain a brief description of what your code does and some information on how to run it. |
2.3 Contacts Format
1 | A contact is something that stores least the following attributes: |
- Name
- Phone
- Company
- Note
Here is a sample CSV file describing many contacts.
1 Name, Phone, Company, Email, Note
2 Elon Musk, 453-6723, SpaceX, emusk@spacex.com
3 Larry Page, 853-0653, Google, lpage@gmail.com
4 Tim Cook, 133-0419, Apple, tcook@apple.com
2.4 Application Commands
- Get input from the user.
- Think of and display a unique name for your application
- Display a welcome message when the application starts.
To make testing easier, add some default contacts so you don’t have to constantly load a CSV file or manually enter contacts.
2.4.1 The exit Command - Close the program.
- Display a goodbye message when the application quits.
1 | 2.4.2 The about Command |
- Print developer information. Developer name, date created, … etc
2.4.3 The info Command - Print number of contacts
- Print number of companies
- Print number of contacts per company
2.4.4 The list Command - List all contacts.
2.4.5 The remove Command - Report contacts updated
- Warn user if trying to remove contact that does not exist
2.4.6 The note Command - Allow user to edit a note associated with a specified contact
- Allow user to see current note
2.4.7 The add Command - Allow user to add a contact. There should be a prompt for each field of a contact.
2.4.8 The load Command - Load a default contacts file when the application starts
- Warn user if entered invalid file
2.4.9 The save Command
Use this command to write a line of a CSV file:
1 savefile.write(“{}, {}, {}, {}, {}\n”.format(
2 name, phone, company, email, note))
1 | 2.4.10 The commands Command |
- Load a set of commands from a file and execute them. An example command file might look like the following.
1 add joe
2 phone: 555-
3 add jane
4 phone: 555-
5 email: jane@jane.jane
6 remove bob
2.5 Extra Credit
- Use a random welcome and goodbye message chosen from a set of available messages.
- Verify CSV save path can be written to, i.e parent directory exits
- Validate user input in add or edit commands. Verify phone, email correct formats. i.e. (xxx)xxx-
xxxx - Add thelookupSearch for contacts by substring. Offer case-insensitive search.
- Allow multiple notes for a given contact. User should be able to list, add, remove notes.
- Stay in each mode before asking user for another command. For example if user wants to add
a bunch of contacts, enter ’add’ mode, add contacts manual, and explicitly exit add mode
with ’exit’ - Group contacts. Add ability to manage groups of contacts. Contacts may exist in multiple
groups. Add an additional command set for working with groups, i.e add, remove, list groups,
list contacts in group etc. - Import contacts from a csv file
- Export contacts to YAML, XML, JSON, etc…
- Associate an image with each contact. Add a command to display the contact’s image.
- Add user login. Each user has a distinct set of contacts that is automatically loaded when the user logs in.
- Use Object Oriented Programming to implement your project.
3 Submitting
You should submit your code as a tarball. It should contain all files used in solving the problems presented in this lab. If you want to include hand drawings, scan and include as PDFs. The submitted file should be named
1 | cse107_firstname_lastname_contacts.tar.gz |