[Vobject] how to parse street addresses with vobject?

Bill Janssen janssen at parc.com
Mon Jan 12 18:30:57 CST 2009


I've got the following vCard:

BEGIN:VCARD
N:Dummy;Bob & Alice;;;
FN:Bob & Alice Dummy
ORG:Dummy Corporation Example, International
EMAIL;TYPE=INTERNET;TYPE=HOME;TYPE=PREF:alice at alumni.mit.edu
EMAIL;TYPE=INTERNET;TYPE=WORK;TYPE=PREF:bob at eink.com
EMAIL;TYPE=INTERNET;TYPE=HOME:bob at alumni.mit.edu
TEL;TYPE=HOME;TYPE=PREF:(415) 461-7238
ITEM1.ADR;TYPE=HOME;TYPE=PREF:;;5690 N. Dexter Ave.;San Francisco;CA;93205;
ITEM1.X-ABADR:us
X-ABUID:E4BF817A-BF92-11D6-882C-00306583F524\=3AABPerson
END:VCARD

I'm trying to read it in and render it, using vobject.vCard.

Read-in goes fine, and I can find the "fn" and "org" and etc.
However, when I ask for the "adr", I just get this undifferentiated
string:

>>> c.contents.get("adr")[0]
<ADR{u'TYPE': [u'HOME', u'PREF']};;5690 N. Dexter Ave.;San Francisco;CA;93205;>
>>>

or, if I ask for the value,

>>> c.contents.get("adr")[0].value
u';;5690 N. Dexter Ave.;San Francisco;CA;93205;'
>>> 

I'd like to get that as a structured value, so that I can ask for
street, city, etc.  Is there a way to do this?

Bill




More information about the VObject mailing list