<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I am using Vobject to parse vcards. I have an issue to access each part
of an address:<br>
<br>
Here is my Vcard:<br>
<b><tt>BEGIN:VCARD<br>
VERSION:3.0<br>
N:Gump;Forrest<br>
FN:Forrest Gump<br>
ORG:Bubba Gump Shrimp Co.<br>
TITLE:Shrimp Man<br>
TEL;TYPE=WORK,VOICE:(111) 555-1212<br>
TEL;TYPE=HOME,VOICE:(404) 555-1212<br>
<font color="#990000">ADR;TYPE=WORK:;;100 Waters
Edge;Baytown;LA;30314;United States of America</font><br>
LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of
America<br>
ADR;TYPE=HOME:;;<font color="#000000">42 Plantation St.;</font><font
color="#000000">Baytown;</font><font color="#000000">LA;</font><font
color="#000000">30314;</font><font color="#000000">United States of
America</font><br>
LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of
America<br>
EMAIL;TYPE=PREF,<a class="moz-txt-link-abbreviated" href="mailto:INTERNET:forrestgump@example.com">INTERNET:forrestgump@example.com</a><br>
REV:20080424T195243Z<br>
END:VCARD<br>
<br>
</tt></b>I can access the first address by typing:<br>
<b><tt>>>> print vcard.adr_list[0]<br>
<ADR{u'TYPE': [u'WORK']}100 Waters Edge<br>
Baytown, LA 30314<br>
United States of America></tt></b><br>
<br>
I can just get the value of this address from:<br>
<b><tt>>>> print vcard.adr_list[0].value<br>
100 Waters Edge<br>
Baytown, LA 30314<br>
United States of America</tt></b><br>
<br>
Or I can get the fields separated by a ";" by using:<br>
<b><tt>>>> print vcard.adr_list[0].serialize()<br>
ADR;TYPE=WORK:<font color="#ff0000">;;</font>100 Waters Edge<font
color="#ff0000">;</font>Baytown<font color="#ff0000">;</font>LA</tt></b><b><tt><font
color="#ff0000">;</font></tt></b><b><tt>30314</tt></b><b><tt><font
color="#ff0000">;</font></tt></b><b><tt>United States of America</tt></b><br>
<br>
However I have to parse this output to get each field. Is there already
a way in Vobject to get each part of the address independently ?
(street, region, postal code, country....) ? <br>
<br>
Thank you for your help and Best Regards,<br>
<br>
Fred.<br>
<br>
</body>
</html>