biweeklybudget.ofxupdater module

exception biweeklybudget.ofxupdater.DuplicateFileException[source]

Bases: exceptions.Exception

Exception raised when trying to parse a file that has already been parsed for the Account (going by the OFX signon date).

class biweeklybudget.ofxupdater.OFXUpdater(acct_id, acct_name, cat_memo=False)[source]

Bases: object

Class to wrap updating the database with a parsed OFX file.

_create_statement(ofx, mtime, filename)[source]

Create an OFXStatement for this OFX file. If one already exists with the same account and filename, raise DuplicateFileException.

Parameters:
  • ofx (ofxparse.ofxparse.Ofx) – Ofx instance for parsed file
  • mtime (datetime.datetime) – OFX file modification time (or current time)
  • filename (str) – OFX file name
Returns:

the OFXStatement object

Return type:

biweeklybudget.models.ofx_statement.OFXStatement

Raises:

DuplicateFileException

_update_bank_or_credit(ofx, stmt)[source]

Update a single OFX file for this Bank or Credit account.

Parameters:
Returns:

the OFXStatement object

Return type:

biweeklybudget.models.ofx_statement.OFXStatement

_update_investment(ofx, stmt)[source]

Update a single OFX file for this Investment account.

Parameters:
Returns:

the OFXStatement object

Return type:

biweeklybudget.models.ofx_statement.OFXStatement

update(ofx, mtime=None, filename=None)[source]

Update a single OFX file for this account.

Parameters:
  • ofx (ofxparse.ofxparse.Ofx) – Ofx instance for parsed file
  • mtime (datetime.datetime) – OFX file modification time (or current time)
  • filename (str) – OFX file name
Returns:

the OFXStatement created by this run

Return type:

biweeklybudget.models.ofx_statement.OFXStatement