@classmethod
def from_api(cls, session):
    """
        Constructs a parser from a :class:`mw.api.Session`

        :Parameters:
            session : :class:`mw.api.Session`
                An open API session

        :Returns:
            An initialized :class:`mw.lib.title.Parser`
        """
    si_doc = session.site_info.query(properties={'namespaces',
        'namespacealiases'})
    return cls.from_site_info(si_doc)
