biweeklybudget.models.account module

class biweeklybudget.models.account.Account(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, biweeklybudget.models.base.ModelAsDict

_sa_class_manager = {'acct_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749770>, 'all_statements': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749050>, 'apr': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707498f0>, 'credit_limit': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749830>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707492f0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749170>, 'interest_class_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749a70>, 'is_active': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749bf0>, 'min_payment_class_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749b30>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749230>, 'negate_ofx_amounts': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707495f0>, 'ofx_cat_memo_to_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707493b0>, 'ofxgetter_config_json': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749530>, 'prime_rate_margin': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707499b0>, 're_fee': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749ef0>, 're_interest_charge': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749cb0>, 're_interest_paid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749d70>, 're_payment': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749e30>, 'reconcile_trans': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f707496b0>, 'vault_creds_path': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8f70749470>}
acct_type

Type of account (Enum AcctType )

all_statements

Relationship to all OFXStatement for this Account

apr

Finance rate (APR) for credit accounts

balance

Return the latest AccountBalance object for this Account.

Returns:latest AccountBalance for this Account
Return type:biweeklybudget.models.account_balance.AccountBalance
credit_limit

credit limit, for credit accounts

description

description

effective_apr

Return the effective APR for a credit account. If prime_rate_margin is not Null, return that added to the current US Prime Rate. Otherwise, return apr.

Returns:Effective account APR
Return type:decimal.Decimal
for_ofxgetter

Return whether or not this account should be handled by ofxgetter.

Returns:whether or not ofxgetter should run for this account
Return type:bool
id

Primary Key

interest_class_name

Name of the biweeklybudget.interest._InterestCalculation subclass used to calculate interest for this account.

is_active

whether or not the account is active and can be used, or historical

is_budget_source

Return whether or not this account should be considered a funding source for Budgets.

Returns:whether or not this account is a Budget funding source
Return type:bool
is_stale

Return whether or not there is stale data for this account.

Returns:whether or not data for this account is stale
Return type:bool
min_payment_class_name

Name of the biweeklybudget.interest._MinPaymentFormula subclass used to calculate minimum payments for this account.

name

name for the account

negate_ofx_amounts

For use in reconciling our Transaction entries with the account’s OFXTransaction entries, whether or not to negate the OfxTransaction amount. We enter Transactions with income as negative amounts and expenses as positive amounts, but most bank OFX statements will show the opposite.

ofx_cat_memo_to_name

whether or not to concatenate the OFX memo text onto the OFX name text; for banks like Chase that use the memo for run-on from the name

ofx_statement

Return the latest OFXStatement for this Account.

Returns:latest OFXStatement for this Account
Return type:biweeklybudget.models.ofx_statement.OFXStatement
ofxgetter_config

Return the deserialized ofxgetter_config_json dict.

Returns:ofxgetter config
Return type:dict
ofxgetter_config_json

JSON-encoded ofxgetter configuration

prime_rate_margin

Margin added to the US Prime Rate to determine APR, for credit accounts.

re_fee

regex for matching transactions as fees

re_interest_charge

regex for matching transactions as interest charges

re_interest_paid

regex for matching transactions as interest paid

re_payment

regex for matching transactions as payments

reconcile_trans

Include Transactions and OFXTransactions from this account when reconciling. Set to False to exclude accounts that are investment, payment only, or otherwise won’t have a matching Transaction for each OFXTransaction.

set_balance(**kwargs)[source]

Create an AccountBalance object for this account and associate it with the account. Add it to the current session.

set_ofxgetter_config(config)[source]

Set ofxgetter configuration.

Parameters:config (dict) – ofxgetter configuration
unreconciled

Return a query to match all unreconciled Transactions for this account.

Parameters:db (sqlalchemy.orm.session.Session) – active database session to use for queries
Returns:query to match all unreconciled Transactions
Return type:sqlalchemy.orm.query.Query
unreconciled_sum

Return the sum of all unreconciled transaction amounts for this account.

Returns:sum of amounts of all unreconciled transactions
Return type:float
vault_creds_path

path in Vault to read the credentials from

class biweeklybudget.models.account.AcctType[source]

Bases: enum.Enum

Bank = 1
Cash = 4
Credit = 2
Investment = 3
Other = 5
_member_map_ = {'Bank': <AcctType.Bank: 1>, 'Cash': <AcctType.Cash: 4>, 'Credit': <AcctType.Credit: 2>, 'Investment': <AcctType.Investment: 3>, 'Other': <AcctType.Other: 5>}
_member_names_ = ['Bank', 'Credit', 'Investment', 'Cash', 'Other']
_member_type_

alias of object

_value2member_map_ = {1: <AcctType.Bank: 1>, 2: <AcctType.Credit: 2>, 3: <AcctType.Investment: 3>, 4: <AcctType.Cash: 4>, 5: <AcctType.Other: 5>}
as_dict