How do I parse a VCard to a Python dictionary?

Posted by lecodesportif on Stack Overflow See other posts from Stack Overflow or by lecodesportif
Published on 2010-03-19T13:00:56Z Indexed on 2010/03/19 13:01 UTC
Read the original article Hit count: 394

Filed under:
|

I'm trying to figure out how to parse a VCard to a Python dictionary using VObject.

How do I convert vobj=vobject.readOne(vcard) into a Python dict?

Sorry for asking such a basic question but I'm a beginner.

© Stack Overflow or respective owner

How do I parse a VCard to a Python dictionary?

Posted by lecodesportif on Stack Overflow See other posts from Stack Overflow or by lecodesportif
Published on 2010-03-19T14:30:06Z Indexed on 2010/03/19 15:51 UTC
Read the original article Hit count: 394

Filed under:
|
|

I'm trying to figure out how to parse a VCard to a Python dictionary using VObject.

vobj=vobject.readOne(string)
print vobj.behavior.knownChildren

This is all I get: {'CATEGORIES': (0, None, None), 'ADR': (0, None, None), 'UID': (0, None, None), 'PHOTO': (0, None, None), 'LABEL': (0, None, None), 'VERSION': (1, 1, None), 'FN': (1, 1, None), 'ORG': (0, None, None), 'N': (1, 1, None), 'PRODID': (0, 1, None)}

How can I populate the dictionary with my VCard data?

© Stack Overflow or respective owner

Related posts about python

Related posts about vcard