Parsing hCard is quite straightforward. 

Let's import some stuff first, namely getUtility to be able to get a parser

>>> from zope.component import getUtility

and the actual hcard parser. This import will register it as available parser:

>>> import pydataportability.microformats.hcard

We need to do the same with the base package

>>> import pydataportability.microformats.base

We also need an interface to retrieve the html parser:

>>> from pydataportability.microformats.base.interfaces import IHTMLParser

The base package has 2 parsers included, one using ElementTree and one using BeautifulSoup. We
will use the latter one. As it's registered as a utility we can simply retrieve it with the 
HTMLParser interface and it's name and instantiate it:

>>> parser = getUtility(IHTMLParser,name="beautifulsoup")()

Now let's open the file "hcard.txt" which contains a lot of different hCard definitions:

>>> from pydataportability.microformats.hcard.tests import testfiles
>>> mf = parser.fromString(testfiles.hcard1)

We will get an microformats parser back which we can ask to parse it:

>>> mf.parse()

Now the microformat parser instance should have various hcards available:

>>> len(mf.microformats['hcard'])
21

>>> vcard1 = mf.microformats['hcard'][0]
>>> str(vcard1)

for name,result in mf.microformats.items():
    print "**",name,"**"
        for r in result:
                print r




