@staticmethod<EOL><INDENT>def from_ofxparse(data, institution):<DEDENT>
description = data.desc if hasattr(data, '<STR_LIT>') else None<EOL>if data.type == AccountType.Bank:<EOL><INDENT>return BankAccount(<EOL>institution=institution,<EOL>number=data.account_id,<EOL>routing_number=data.routing_number,<EOL>account_type=data.account_type,<EOL>description=description)<EOL><DEDENT>elif data.type == AccountType.CreditCard:<EOL><INDENT>return CreditCardAccount(<EOL>institution=institution,<EOL>number=data.account_id,<EOL>description=description)<EOL><DEDENT>elif data.type == AccountType.Investment:<EOL><INDENT>return BrokerageAccount(<EOL>institution=institution,<EOL>number=data.account_id,<EOL>broker_id=data.brokerid,<EOL>description=description)<EOL><DEDENT>raise ValueError("<STR_LIT>" % data.type)<EOL>
Instantiate :py:class:`ofxclient.Account` subclass from ofxparse
        module

        :param data: an ofxparse account
        :type data: An :py:class:`ofxparse.Account` object
        :param institution: The parent institution of the account
        :type institution: :py:class:`ofxclient.Institution` object