biweeklybudget.prime_rate module

class biweeklybudget.prime_rate.PrimeRateCalculator(db_session)[source]

Bases: object

_get_prime_rate()[source]

Get the US Prime Rate from MarketWatch; update the DB and return the value.

Returns:current US Prime Rate
Return type:decimal.Decimal
_rate_from_marketwatch()[source]
calculate_apr(margin)[source]

Calculate an APR based on the prime rate.

Parameters:margin (decimal.Decimal) – margin added to Prime Rate to get APR
Returns:effective APR
Return type:decimal.Decimal
prime_rate

Return the current US Prime Rate

Returns:current US Prime Rate
Return type:decimal.Decimal