Google api gdata.data.PhoneNumber:如何获取电话号码的类型?

Google api gdata.data.PhoneNumber:如何获取电话号码的类型?,google-api,gdata,google-api-python-client,Google Api,Gdata,Google Api Python Client,使用gdata.data.PhoneNumber类,如何获取该电话号码的类型(家庭/企业/手机/等) 这是我正在引用的文档:您应该查找“rel”属性。 以下是示例代码: 它没有访问“rel”属性,但它在那里,我发誓:) 获得PhoneNumer实例后,您可以使用以下命令打印每个属性: 以下是“rel”的列表()。我不知道是否所有都适用于电话号码,但它可能有助于检查类型: FAX_REL = 'http://schemas.google.com/g/2005#fax' HOME_REL = 'ht

使用gdata.data.PhoneNumber类,如何获取该电话号码的类型(家庭/企业/手机/等)

这是我正在引用的文档:

您应该查找“rel”属性。 以下是示例代码:

它没有访问“rel”属性,但它在那里,我发誓:)

获得PhoneNumer实例后,您可以使用以下命令打印每个属性:

以下是“rel”的列表()。我不知道是否所有都适用于电话号码,但它可能有助于检查类型:

FAX_REL = 'http://schemas.google.com/g/2005#fax'
HOME_REL = 'http://schemas.google.com/g/2005#home'
HOME_FAX_REL = 'http://schemas.google.com/g/2005#home_fax'
ISDN_REL = 'http://schemas.google.com/g/2005#isdn'
MAIN_REL = 'http://schemas.google.com/g/2005#main'
MOBILE_REL = 'http://schemas.google.com/g/2005#mobile'
OTHER_REL = 'http://schemas.google.com/g/2005#other'
OTHER_FAX_REL = 'http://schemas.google.com/g/2005#other_fax'
PAGER_REL = 'http://schemas.google.com/g/2005#pager'
RADIO_REL = 'http://schemas.google.com/g/2005#radio'
TELEX_REL = 'http://schemas.google.com/g/2005#telex'
TTL_TDD_REL = 'http://schemas.google.com/g/2005#tty_tdd'
WORK_REL = 'http://schemas.google.com/g/2005#work'
WORK_FAX_REL = 'http://schemas.google.com/g/2005#work_fax'
WORK_MOBILE_REL = 'http://schemas.google.com/g/2005#work_mobile'
WORK_PAGER_REL = 'http://schemas.google.com/g/2005#work_pager'
NETMEETING_REL = 'http://schemas.google.com/g/2005#netmeeting'
这些其他“rel”可以(或者可能应该?)与对象的“label”属性连接

print(dir(phone_number))
FAX_REL = 'http://schemas.google.com/g/2005#fax'
HOME_REL = 'http://schemas.google.com/g/2005#home'
HOME_FAX_REL = 'http://schemas.google.com/g/2005#home_fax'
ISDN_REL = 'http://schemas.google.com/g/2005#isdn'
MAIN_REL = 'http://schemas.google.com/g/2005#main'
MOBILE_REL = 'http://schemas.google.com/g/2005#mobile'
OTHER_REL = 'http://schemas.google.com/g/2005#other'
OTHER_FAX_REL = 'http://schemas.google.com/g/2005#other_fax'
PAGER_REL = 'http://schemas.google.com/g/2005#pager'
RADIO_REL = 'http://schemas.google.com/g/2005#radio'
TELEX_REL = 'http://schemas.google.com/g/2005#telex'
TTL_TDD_REL = 'http://schemas.google.com/g/2005#tty_tdd'
WORK_REL = 'http://schemas.google.com/g/2005#work'
WORK_FAX_REL = 'http://schemas.google.com/g/2005#work_fax'
WORK_MOBILE_REL = 'http://schemas.google.com/g/2005#work_mobile'
WORK_PAGER_REL = 'http://schemas.google.com/g/2005#work_pager'
NETMEETING_REL = 'http://schemas.google.com/g/2005#netmeeting'