Coder Social home page Coder Social logo

phonebook's Introduction

#Phonebook Phonebook is an basic command-line phonebook application implementing the Hacker School phonebook specification. It stores names and phone numbers in comma-separated text files (though it could be easily extended to use a more robust backend).

##Installation Download Phonebook:

git clone https://github.com/KatrinaE/phonebook.git phonebook

Make Phonebook executable:

cd path-to-phonebook
chmod u+x phonebook

Add Phonebook to your path, e.g.:

ln -s path-to-phonebook/phonebook /usr/local/bin/phonebook

##Usage

Available commands are:

  • create: Create a new phonebook with the given filename

      phonebook create phonebook.txt
    
  • set-default: Set the given phonebook to be the default

      phonebook set-default phonebook.txt
    

    (To use a non-default phonebook, use the -b option)

      phonebook create different-phonebook.txt
      phonebook lookup 'John Smith' -b different-phonebook.txt
    
  • add: Add a person to the phonebook

      phonebook add 'John Smith' '(987) 654-3210'
    

    A person may only be in the phonebook once - you cannot store e.g. one entry containing a person's home phone number and another entry with his cell phone number.

  • remove: Remove a person from the phonebook

      phonebook remove 'John Smith'
    
  • lookup: Look up a person by name

      phonebook lookup 'John'
    

    Lookup matches all entries containing the lookup string and prints them to the console.

  • reverse-lookup: Look up a person by phone number

      phonebook reverse-lookup '(987) 654-3210'
    

    Reverse-lookup may return more than one person if both of them have the same phone number.

    Phone numbers are validated using the parser implemented in 'Dive into Python'. It supports US phone numbers entered in any format. The numbers are stored and displayed in the format 'XXX XXX XXXX'.

To-Dos

'Default phonebook' behavior is currently untested.

phonebook's People

Stargazers

 avatar

Watchers

 avatar

Forkers

mhcrnl

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.