Looking Up Address Book Entries =============================== The main script (``whoswho.py``) is used to look up entries in your address books. Any arguments you add on the command line will be matched against names in your address book.:: $ python whoswho.py Andy Will find any person or company with 'Andy' in their name. Note that the search is as flexible as possible and won't just find names starting with the characters 'Andy' but any name that contains those letters in that order as well. For example this search will find the names 'Sandy' and 'Mandy' as well. The results of your search are displayed in an abbreviated fashion - with just the name, phone numbers and email addresses. For instance my previous search on my address book will show these results;:: ID: 1 Name: Andrew John Todd Phone (home): +61 2 9999 9999 Phone (mobile): +61 412 111111 Phone (mobile): +61 458 222222 Phone (work): +61 2 8235 8888 Email (home): andy47@halfcooked.com Email (work): andy.todd@myemployer.com If you are lucky enough to know more than one Andy there will be multiple results displayed. All of the entries in your address books (defined in your :doc:`configuration` file) with names that match your search string ('Smith' in this example) will be displayed.:: $ python whoswho.py Smith :: ID: 24 Name: John Smith Phone (mobile): 555 702 4999 Email (home): john.smith@gmail.com ID: 26 Name: Gemma Smith Phone (mobile): 555 702 4972 Email (home): gemma.smith@gmail.com Full Entry Details ------------------ If you want to display the full details of entries found use the ``-f`` flag on the command line. Full details include any addresses from the XML file:: $ python whoswho.py -f Andy :: ID: 1 Name: Andrew John Todd Address: 1 My Street My Suburb My City State and Postcode Australia Phone (home): +61 2 9999 9999 Phone (mobile): +61 412 111111 Phone (mobile): +61 458 222222 Phone (work): +61 2 8235 8888 Email (home): andy47@halfcooked.com Email (work): andy.todd@myemployer.com You can also use ``--full`` instead of ``-f``. Individual Entry Details ------------------------ If you know the file ID value of the entry you wish to display just use ``-i`` followed by the value. If you do use the ``-i`` flag you can specify multiple ID values. Any non-numeric search strings will be ignored. For instance, to repeat the search above for my entry I can type:: $ python whoswho.py -i 1 :: ID: 1 Name: Andrew John Todd Address: 1 My Street My Suburb My City State and Postcode Australia Phone (home): +61 2 9999 9999 Phone (mobile): +61 412 111111 Phone (mobile): +61 458 222222 Phone (work): +61 2 8235 8888 Email (home): andy47@halfcooked.com Email (work): andy.todd@myemployer.com You can also use ``--id`` instead of ``-i``. Search By Category ------------------ Categories in whoswho are like tags. Each address book entry can have zero, one or more categories. See :doc:`address_books` for more information. You can search for all address book entries with a specific category by using the ``-c`` flag. With this option you also need to specify a search string. If you want to show all entries from a category use the '%' wild card search string:: $ python whoswho.py -c friend % :: ID: 38 Name: Van Nguyen Phone (mobile): 555 813 2323 Email (home): van.nguyen@gmail.com ID: 74 Name: Brad Goodes Phone (mobile): 555 367 4543 Email (home): brad_goodes57@yahoo.com You can also use ``--category`` instead of ``-c``. Search By Company ----------------- You can restrict the search results to people from a specific company by using the ``-m`` (or ``--company``) option on the command line. Specify the company name after the ``-m`` and you will see everyone in your address book who works for that company.:: $ python whoswho.py -m Mozilla :: ID: 73 Name: David Programmer Phone (mobile): 555 715 3333 Email (home): david.programmer@mozilla.org Any further arguments after the company name are ignored.