Convention#
- class rateslib.scheduling.Convention(variant)#
Bases:
objectSpecifier for day count conventions
Attributes Summary
Methods Summary
dcf(start, end[, termination, frequency, ...])Calculate the day count fraction of a period.
to_json()Return a JSON representation of the object.
Attributes Documentation
- Act360 = <rl.Convention.Act360>#
- Act365F = <rl.Convention.Act365F>#
- ActActICMA = <rl.Convention.ActActICMA>#
- ActActICMAStubAct365F = <rl.Convention.ActActICMAStubAct365F>#
- ActActISDA = <rl.Convention.ActActISDA>#
- Bus252 = <rl.Convention.Bus252>#
- One = <rl.Convention.One>#
- Thirty360 = <rl.Convention.Thirty360>#
- ThirtyE360 = <rl.Convention.ThirtyE360>#
- ThirtyE360ISDA = <rl.Convention.ThirtyE360ISDA>#
- ThirtyU360 = <rl.Convention.ThirtyU360>#
- YearsAct360 = <rl.Convention.YearsAct360>#
- YearsAct365F = <rl.Convention.YearsAct365F>#
- YearsMonths = <rl.Convention.YearsMonths>#
Methods Documentation
- dcf(start, end, termination=None, frequency=None, stub=None, calendar=None, adjuster=None)#
Calculate the day count fraction of a period.
- Parameters:
start (datetime) – The adjusted start date of the calculation period.
end (datetime) – The adjusted end date of the calculation period.
termination (datetime, optional) – The adjusted termination date of the leg. Required only for some
convention.frequency (Frequency, str, optional) – The frequency of the period. Required only for some
convention.stub (bool, optional) – Indicates whether the period is a stub or not. Required only for some
convention.roll (str, int, optional) – Used only if
frequencyis given in string form. Required only for someconvention.calendar (str, Calendar, optional) – Used only of
frequencyis given in string form. Required only for someconvention.adjuster (Adjuster, str, optional) – The
Adjusterused to convert unadjusted dates to adjusted accrual dates on the period. Required only for someconvention.
- Return type:
float
Notes
Further details on the required arguments can be found under
Conventionat the lower level Rust docs, see rateslib-rs: Scheduling.
- to_json()#
Return a JSON representation of the object.
- Return type:
str