How to use the ofxtools.OfcConverter function in ofxtools

To help you get started, we’ve selected a few ofxtools 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 wesabe / fixofx / fixofx.py View on Github external
# The file is already OFX 2 -- return it unaltered, ignoring
        # any of the parameters passed to this method.
        return text
    
    elif filetype.startswith("OFX"):
        if verbose: sys.stderr.write("Converting to OFX/2.0...\n")
        
        # This will throw a ParseException if it is unable to recognize
        # the source format.
        response = ofx.Response(text, debug=debug)        
        return response.as_xml(original_format=filetype)
    
    elif filetype == "OFC":
        if verbose: sys.stderr.write("Beginning OFC conversion...\n")
        converter = ofxtools.OfcConverter(text, fid=fid, org=org, curdef=curdef,
                                          lang=lang, debug=debug)
        
        # This will throw a ParseException if it is unable to recognize
        # the source format.
        if verbose: 
            sys.stderr.write("Converting to OFX/1.02...\n\n%s\n\n" %
                             converter.to_ofx102())
            sys.stderr.write("Converting to OFX/2.0...\n")
                                             
        return converter.to_xml()
    
    elif filetype == "QIF":
        if verbose: sys.stderr.write("Beginning QIF conversion...\n")
        converter = ofxtools.QifConverter(text, fid=fid, org=org,
                                          bankid=bankid, accttype=accttype, 
                                          acctid=acctid, balance=balance,

ofxtools

Library for working with Open Financial Exchange (OFX) data

GPL-3.0
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages