NamedCal#
- class rateslib.calendars.NamedCal(name)#
A calendar wrapper of a
UnionCal
created by a string name.- Parameters:
name – A string defining the calendar. Named calendars separated by commas, and associated settlement calendars separated by pipes. Valid examples are; “tgt”, “tgt,ldn”, “tgt,ldn|fed,stk”,
Attributes Documentation
- name#
- union_cal#
See also
Cal
: Base calendar object type.UnionCal
: Calendar object designed to merge calendars under financial date rules.Methods Summary
add_bus_days
(date, days, settlement)Return a business date separated by days from an input business date.
add_days
(date, days, modifier, settlement)Return a date separated by calendar days from input date, and rolled with a modifier.
add_months
(date, months, modifier, roll, ...)Return a date separated by months from an input date, and rolled with a modifier.
bus_date_range
(start, end)Return a list of business dates in a range.
cal_date_range
(start, end)Return a list of calendar dates in a range.
is_bus_day
(date)Return whether the date is a business day.
is_non_bus_day
(date)Return whether the date is not a business day.
is_settlement
(date)Return whether the date is a business day in an associated settlement calendar.
lag
(date, days, settlement)Adjust a date by a number of business days, under lag rules.
roll
(date, modifier, settlement)Adjust a non-business date to a business date under a specific modification rule.
to_json
()Return a JSON representation of the object.
Methods Documentation
- add_bus_days(date, days, settlement)#
Return a business date separated by days from an input business date.
See
Cal.add_bus_days
.
- add_days(date, days, modifier, settlement)#
Return a date separated by calendar days from input date, and rolled with a modifier.
See
Cal.add_days
.
- add_months(date, months, modifier, roll, settlement)#
Return a date separated by months from an input date, and rolled with a modifier.
See
Cal.add_months
.
- bus_date_range(start, end)#
Return a list of business dates in a range.
See
Cal.bus_date_range
.
- cal_date_range(start, end)#
Return a list of calendar dates in a range.
See
Cal.cal_date_range
.
- is_bus_day(date)#
Return whether the date is a business day.
See
Cal.is_bus_day
.
- is_non_bus_day(date)#
Return whether the date is not a business day.
See
Cal.is_non_bus_day
.
- is_settlement(date)#
Return whether the date is a business day in an associated settlement calendar.
If no such associated settlement calendar exists this will return True.
See
Cal.is_settlement
.
- lag(date, days, settlement)#
Adjust a date by a number of business days, under lag rules.
See
Cal.lag
.
- roll(date, modifier, settlement)#
Adjust a non-business date to a business date under a specific modification rule.
See
Cal.roll
.
- to_json()#
Return a JSON representation of the object.
- Return type:
str