Package: goobook
Table of ContentsAboutInstallation InstructionsConfigurationUsageLinks, Feedback and getting involvedAboutThe purpose of GooBook is to make it possible to use your Google Contacts from
the command-line and from MUAs such as Mutt.
It can be used from Mutt the same way as abook.NoteGooBook is looking for a new maintainer seehttps://gitlab.com/goobook/goobook/-/issues/90Installation InstructionsThere is a number of ways to install Python software.Using pipUsing a source tarballUsing source directly from gitoriusFrom a distribution specific repositoryWhich version to useIf you only have Python 2.7 you need to use GooBook 1.x.
If you have Python 3.7+ you need to use GooBook 3.x.There will be no further feature releases in the 1.x series.pipThis is the recommended way to install goobook for most users that
don’t have it available in their distribution.
When installing this way you will not need to download anything manually.Install like this:$ pip install --user goobookThis will install goobook as ~/.local/bin/goobook (In a UNIX environment).PoetryThis is the recommended way if you want to run from a git checkout.
Install poetry if you don’t have it,https://python-poetry.org.clone the git repos, cd into in, and run:$ poetry installGoobook is now installed in a virtualenv created by poetry.
You can test goobook by running:$ poetry run goobookTo locate the virtualenv where goobook is installed:$ poetry env list --full-pathSource installation from tarballDownload the source tarball, uncompress it, then run the install command:$ tar -xzvf goobook-*.tar.gz
$ cd goobook-*
$ sudo python ./setup.py installConfigurationFirst you need to authenticate yourself:Go tohttps://developers.google.com/people/quickstart/pythonand click “Enable the People API”select a name (ex. GooBook)select desktop app and createsave the client_id and client_secret to be used belowrun:$ goobook authenticate -- CLIENT_ID CLIENT_SECRETand follow the instructions, this part is web based.If the procedure above to get client_id and secret stops working this is an alternative way to do it:Go to the Google developer consolehttps://console.developers.google.com/Create a new project (drop down at the top of the screen) (you are free to use an existing one if you so prefer)Select the newly created projectGo to OAuth consent screen from sidebarSelect the interal user type if you can but most will only be able to select external.On next screen give it a name (ex. GooBook)select Add scope, click manually paste and write “https://www.googleapis.com/auth/contacts” inte the lower text box.and hit hit add and then saveGo to Credentials from sidebarClick Create Credentials from top, then OAuth Client ID in the dropdownChoose Desktop app, enter any name you want, and hit createsave the client_id and client_secret to be used with goobook authenticateTo get access too more settings you can create a configuration file:goobook config-template > ~/.config/goobookrcIt will look like this:# Use this template to create your ~/.goobookrc

# "#" or ";" at the start of a line makes it a comment.

[DEFAULT]
# The following are optional, defaults are shown when not other specified.

# This file is written by the oauth library, and should be kept secure,
# it's like a password to your google contacts.
# default is to place it in the XDG_DATA_HOME
;oauth_db_filename: ~/.goobook_auth.json

;cache_filename: ~/.goobook_cache   # default is in the XDG_CACHE_HOME
;cache_expiry_hours: 24
;filter_groupless_contacts: yes

# New contacts will be added to this group in addition to "My Contacts"
# Note that the group has to already exist on google or an error will occur.
# One use for this is to add new contacts to an "Unsorted" group, which can
# be sorted easier than all of "My Contacts".
;default_group:FilesGooBook is using three files, the optional config file that can be placed in
theXDG_CONFIG_HOME(~/.config/goobookrc) or in the home directory
(~/.goobookrc).The authentication file that is created by running goobook authenticate inXDG_DATA_HOME(~/.local/share/goobook_auth.json) but can also be placed
in the home directory (~/.goobook_auth.json).The contacts cache file that is created inXDG_CACHE_HOME(~/.cache/goobook_cache) but can also be placed in the home directory
(~/.goobook_cache).Proxy settingsIf you use a proxy you need to set thehttps_proxyenvironment variable.MuttIf you want to use goobook from mutt.Set in your .muttrc file:set query_command="goobook query %s"to query address book. (Normally bound to “Q” key.)If you want to be able to use <tab> to complete email addresses instead of Ctrl-t add this:bind editor <Tab> complete-queryTo add email addresses (with “a” key normally bound to create-alias command):macro index,pager a "<pipe-message>goobook add<return>" "add the sender address to Google contacts"If you want to add an email’s sender to Contacts, press a while it’s selected in the index or pager.UsageTo query your contacts:$ goobook query QUERYThe add command reads a email from STDIN and adds the From address to your Google contacts:$ goobook addThe cache is updated automatically according to the configuration but you can also force an update:$ goobook reloadFor more commands see:$ goobook -hand:$ goobook COMMAND -hLinks, Feedback and getting involvedPyPI home:https://pypi.org/project/goobook/Code Repository:http://gitlab.com/goobook/goobookIssue tracker:https://gitlab.com/goobook/goobook/issuesMailing list:http://groups.google.com/group/goobook