GithubHelp home page GithubHelp logo

pb's Introduction

pb

pb is a command line tool that manages phone books, via the interface below.

Help

$ pb --help
Usage: pb.py [OPTIONS] COMMAND [ARGS]...

  pb: a phone book manager

Options:
  --help  Show this message and exit.

Commands:
  add             add a new person to the phonebook
  change          change a person in the phonebook
  create          create a new database
  lookup          lookup all phone numbers that match name
  remove          remove a person from the phonebook
  reverse-lookup  lookup a name by phone number

Installation

Recommended is to use virtualenv and setuptools:

virtualenv venv
. venv/bin/activate
pip install .

Simplest way is:

pip3 install click
alias pb='python pb.py'

Tests

./tests.sh

Sample session

$ pb lookup Sarah hsphonebook.pb
no such phonebook

$ pb create hsphonebook.pb
created phonebook hsphonebook.pb in the current directory

$ pb lookup Sarah hsphonebook.pb
0 results found

$ pb add 'Sarah Ahmed' '432 123 4321'
added 'Sarah Ahmed (432 123 4321)'

$ pb add 'Sarah Apple' '509 123 4567'
added 'Sarah Apple (509 123 4567)'

$ pb lookup Sarah hsphonebook.pb
Sarah Ahmed 432 123 4321
Sarah Orange 123 456 7890

$ pb add 'Sarah Ahmed' '123 456 7890' hsphonebook.pb
'Sarah Ahmed' already in 'hsphonebook.pb'

$ pb change 'Haras Ahmed' '123 432 1234' hsphonebook.pb
no such person 'Haras Ahmed' in 'hsphonebook.pb'

$ pb remove 'Haras Ahmed' '123 432 1234' hsphonebook.pb
no such person 'Haras Ahmed' in 'hsphonebook.pb'

$ pb change 'Sarah Ahmed' '123 432 1234' hsphonebook.pb
'Sarah Ahmed' number changed to '123 432 1234'

$ pb reverse-lookup '312 432 5432' hsphonebook.pb
no one found with number '312 432 5432'

$ pb reverse-lookup '123 432 1234' hsphonebook.pb
Sarah Ahmed 123 432 1234

pb's People

Watchers

 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.