How to use the ofxparse.AccountType.Bank function in ofxparse

To help you get started, we’ve selected a few ofxparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jseutter / ofxparse / tests / test_parse.py View on Github external
def testThatReturnedAccountAlsoHasAStatement(self):
        stmtrs = soup_maker(self.input)
        account = OfxParser.parseStmtrs(
            stmtrs.find('stmtrs'), AccountType.Bank)[0]
        self.assertTrue(hasattr(account, 'statement'))
github jseutter / ofxparse / tests / test_parse.py View on Github external
def testThatParseStmtrsReturnsAnAccount(self):
        stmtrs = soup_maker(self.input)
        account = OfxParser.parseStmtrs(
            stmtrs.find('stmtrs'), AccountType.Bank)[0]
        self.assertEqual('12300 000012345678', account.number)
        self.assertEqual('160000100', account.routing_number)
        self.assertEqual('CHECKING', account.account_type)
github captin411 / ofxclient / ofxclient / account.py View on Github external
def from_ofxparse(data, institution):
        """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
        """

        description = data.desc if hasattr(data, 'desc') else None
        if data.type == AccountType.Bank:
            return BankAccount(
                institution=institution,
                number=data.account_id,
                routing_number=data.routing_number,
                account_type=data.account_type,
                description=description)
        elif data.type == AccountType.CreditCard:
            return CreditCardAccount(
                institution=institution,
                number=data.account_id,
                description=description)
        elif data.type == AccountType.Investment:
            return BrokerageAccount(
                institution=institution,
                number=data.account_id,
                broker_id=data.brokerid,