In case anybody has a similar issue to mine, here's a link to a gist showing the completed script: add-contact.py.