quantlib.time.daycounters.simple.SimpleDayCounter.year_fraction

SimpleDayCounter.year_fraction(self, Date date1, Date date2, Date ref_start=Date(), Date ref_end=Date())

Returns the period between two dates as a fraction of year.