Period Classes

Period

class cred.period.Period(i)

Superclass for InterestPeriod.

Parameters:i (int) – Zero-based period index (e.g. the fourth period will have index 3)
add_display_field(value, name)

Adds value as an attribute named name to the period marks it as a display field. Display field attributes are included in period.schedule.

Parameters:
  • value – Numerical value of attribute
  • name (str) – Name of attribute
add_payment(value, name)

Adds value as an attribute of the period object named name and marks it as a payment. Payment attributes are included in period.schedule.

Parameters:
  • value – Numerical value of attribute
  • name (str) – Name of attribute
get_payment()

Returns the sum of payment attributes.

schedule()

Returns the period schedule as a {name: value} dictionary.

InterestPeriod

class cred.period.InterestPeriod(i)

Period type used by PeriodicBorrowing and its subclasses.

add_bop_principal(amt, name='bop_principal')

Adds the value as a period attribute and marks it as the beginning of period principal balance. Each period can only have one beginning principal balance attribute. Also added as an attribute that should be included in the schedule.

add_end_date(dt, name='end_date')

Add an attribute to the object and mark it as the period end date. There can only be one end date. Also marks the attribute as a field that should be added to the period schedule.

add_interest_pmt(amt, name='interest_payment')

Adds the value as a period attribute and marks it as an interest payment. Also added as an attribute that should be included in the schedule.

add_pmt_date(dt, name='payment_date')

Add an attribute to the object and mark it as the period payment date. There can only be one payment date. Also marks the attribute as a field that should be added to the period schedule.

add_principal_pmt(amt, name='principal_payment')

Adds the value as a period attribute and marks it as a principal payment. Also added as an attribute that should be included in the schedule.

add_start_date(dt, name='start_date')

Add an attribute to the object and mark it as the period start date. There can only be one start date. Also marks the attribute as a field that should be added to the period schedule.

get_bop_principal()

Beginning of period (BoP) principal amount

get_end_date()

Period end date

get_interest_pmt()

Returns the sum of attributes marked as interest payments

get_pmt_date()

Returns the sum of attributes marked as payments, interest payments, principal payments

get_principal_pmt()

Returns the sum of attributes marked as principal payments

get_start_date()

Period start date