Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Contact Book

Here is an example of contact book you can use for inspiration:

Here are resources that you can use to build your contact book:

00:00 Command-Line Project Ideas. In this section, you’re going to take a look at some projects which lend themselves to the command line. Across the entire course, some will clearly be suited more for one platform than another, but many of these may form the basis of projects which can then be taken to either web or GUI format.

00:19 The projects in this section are a contact book, site connectivity checker, bulk file rename tool, and a directory tree generator. First up, contact book. We come across loads of people daily, we make acquaintances and friends, we get their contacts to keep in touch later on. However, keeping all those details can be hard. One way to do this is to write the contact details down, but this isn’t secure as a physical book can easily be lost.

00:47 This is where a contact book project comes in. A contact book is a tool for saving a contact’s details—name, address, phone number, and email address—as well as the other information you may find useful. With this project idea, users can save their contacts with less risk of losing the saved contact details.

01:03 It’ll always be accessible from their computer through the command line. So, let’s take a look at an example of a contact book program for the command line. Onscreen, you’re seeing an implementation of a contact book using a text-based command-line interface. This is a commercial product, Borland Sidekick, which was extremely popular in the 80s and early 90s.

01:25 As you can see onscreen, it implements most of the functionality we would need for our contact book, but notice that in this case, due to the age of the software, email addresses are not present in each card. However, it’s easy and quick to navigate between the cards using the cursor keys or onscreen controls. And this is a fully functional program which you would do well to try and imitate with your version of the contact book.

01:50 Now, let’s look at some of the technical details of how you would implement the contact book. The first requirement is data storage. Typically, you’d use a library such as sqlite3.

02:00 This is a file-based format which is simple to get started with and yet powerful enough to power this application. You’d need to handle contact creation, update, and deletion—creating text-based forms, which will allow creation and updating of the information—and selection and deletion of records, where necessary. You’d need to implement search using the regex module re, allowing complex search patterns across all of the fields in your database.

02:27 And, you’ll need to think about onscreen presentation. While the format seen for Borland Sidekick was impressive, it may be difficult to implement in practice. With all of these projects, you’re going to see some extra challenges, which may be features that you can implement once you’ve got the basics down and want to stretch your legs a little bit. Firstly, backing up the database, whether locally or to the cloud. If the database file gets deleted, you’re in the same position as someone who’s lost their physical address book, so being able to back up automatically—either to local file storage or to cloud-based storage—would be a useful feature to have.

03:02 You could look into the options for printing, using a library such as PyPDF2, which allows creation of PDF files which can then be printed from your computer.

03:11 You could look into implementing multiple users and the changes that that would mean across your database, and linked to this, you could also look at user levels, where it’s possible to share information between different users, or give some users powers that others do not have.

dejiok on Aug. 13, 2020

Hi Darren, excellent project ideas. Thank you for sharing these. If I was going to choose one for each platform, which would you suggest that will be the most challenging and consequently provide deeper learning.

Abby Jones on Aug. 13, 2020

These are great ideas, which is the worst part of programming for me. Thank you!

Become a Member to join the conversation.