最近有用程序管理自己联系人的想法,所以学习了一下google contact的api 作为一个起步放出 python 获取所有联系人的代码与大家分享:
'''
Created on 2011-4-10
@author: wary
'''
from gdata.contacts.client import ContactsQuery, ContactsClient
def PrintFeed(feed):
for i,entry in enumerate(feed.entry):
print '\n%s %s' % (i+1,entry.title.text)
for email in entry.email:
if email.primary and email.primary == 'true':
print ' %s' % (email.address)
for phone_number in entry.phone_number:
print phone_number.to_string(),
print phone_number.uri,
if __name__ == '__main__':
email = 'email@gmail.com'
password ='passwd'
appname = 'wary-contactsSync-1.0'
client = ContactsClient(source = appname)
#登录客户端
client.ClientLogin(email, password, source = client.source)
#设置获取联系人的条件 最长结果 以及排序方式 不设置的话 默认只返回25条数据
query = ContactsQuery()
query.max_results = 1000
query.orderby = 'lastmodified'
#获取联系人
feed = client.GetContacts(q = query)
PrintFeed(feed)
分享到:
相关推荐
javascript抓取google联络人的例子
Google Contact API and sample
资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:contact_sites-1.0.7-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
此插件可使用Google客户端库通过商店访问用户的Google联系人。 该计划也将支持更新和创建联系人,但是目前仅实现了读取访问。 安装 npm install --save-dev ember-cli-google-contact 或者,使用最新的ember-cli ...
InContact API InContact API的瑰宝 安装 邦德勒 将宝石添加到您的Gemfile中: gem 'incontact_api' 或者 手动地 gem install incontact_api 环境变量 将以下内容定义为环境变量。 UCN_URL UCN_KEY GRANT_TYPE...
contact_api:CRUD Flask REST API
资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:cmsplugin_contact-0.9.1-py2.5.egg 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
特此免费授予获得此软件和相关文档文件(“软件”)副本的任何人无限制地处理软件的权利,包括但不限于使用,复制,修改,合并的权利,发布,分发,再许可和/或出售本软件的副本,并允许具备软件的人员这样做,但须...
Nodejs-Contact-API现场测试从以下位置填写联系人: : 查看JSON中的所有联系人: :
GO Contact Sync Mod 将您的 Microsoft Outlook 联系人与您的 Google Mail 地址簿同步,包括图片、类别和联系人备注。 它还可以根据需要将您的 Outlook 日历约会同步到 Google 日历。 此 Mod 分支为明显已死的项目...
用Python编写的ActiveCampaign API包装器。 该库支持最新的API版本3。如果要查找ActiveCampaign也支持的API版本1,请检查以下内容。 安装(API v3) pip install activecampaign-python 要求 - requests 用法 ...
contact_book 简单的联系书来学习python
资源分类:Python库 所属语言:Python 资源全名:collective.contact.core-1.12.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:collective.contact.facetednav-1.1.8.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
[alpha]常量联系人API(v3)的Python接口 当前,此程序包仅创建与持续接触的连接,并且仅一个api调用已实现为测试。 安装 git clone https://github.com/stephen-d-wells/constant_contact cd constant_contact pip ...
资源分类:Python库 所属语言:Python 资源全名:django-contact-form-recaptcha-1.6.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:django-crispy-contact-form-0.1.11.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059