finpricing.utils.day_count
#
Module Contents#
Classes#
Generic enumeration. |
|
- class finpricing.utils.day_count.DayCountTypes[source]#
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- ACT_360 = 0#
- ACT_365 = 1#
- THIRTY_360 = 2#
- ACT_ACT_ISDA = 3#
- Thirty_E_360 = 4#
- Thirty_E_360_ISDA = 5#
- class finpricing.utils.day_count.DayCount(dccType: DayCountTypes)[source]#
- year_frac#
- days_between(start_date: finpricing.utils.date.Date, end_date: finpricing.utils.date.Date, include_end=False) tuple [source]#
Return the number of days and year fraction using a specific day count convention
- Returns:
(days, fraction of year)
- Return type:
tuple
- year_fraction(start_date: finpricing.utils.date.Date | datetime.date, end_date: finpricing.utils.date.Date | datetime.date, next_coupon_date: finpricing.utils.date.Date = None) float [source]#
Return the fraction of year between two dates using a specific day count convention
The actual calculation is done in days_between() method.
- convert_dates_to_times(anchor_date: finpricing.utils.date.Date, dates: list[finpricing.utils.date.Date]) list[float] [source]#
Return a list of time fraction (year fraction) between anchor date and each date in the list