DefaultFixingsLoader#
- class rateslib.data.loader.DefaultFixingsLoader#
Bases:
_BaseFixingsLoaderThe
_BaseFixingsLoaderimplemented by default.This loader searches a particular local directory for CSV files.
Attributes Summary
The local directory in which data CSV files may be located.
A dictionary of the (state id, timeseries, data range) keyed by identifiers.
Methods Summary
add(name, series[, state])Add a timeseries to the data loader directly from Python.
get_stub_ibor_fixings(value_start_date, ...)Return the tenors available in the
Fixingsobject for determining an IBOR type stub period.pop(name)Remove a timeseries from the data loader.
Attributes Documentation
- directory#
The local directory in which data CSV files may be located.
- loaded#
A dictionary of the (state id, timeseries, data range) keyed by identifiers.
Methods Documentation
- add(name, series, state=NoInput.blank)#
Add a timeseries to the data loader directly from Python.
- Parameters:
name (str) – The string identifier for the timeseries.
series (Series[DualTypes]) – The timeseries to add to static data.
- Return type:
None
Examples
In [1]: ts = Series(index=[dt(2000, 1, 1)], data=[666.0]) In [2]: fixings.add("my_timeseries", ts) In [3]: fixings["my_timeseries"] Out[3]: (-4215404932798160582, reference_date 2000-01-01 666.0 Name: rate, dtype: float64, (Timestamp('2000-01-01 00:00:00'), Timestamp('2000-01-01 00:00:00'))) In [4]: fixings.pop("my_timeseries") Out[4]: reference_date 2000-01-01 666.0 Name: rate, dtype: float64
- get_stub_ibor_fixings(value_start_date, value_end_date, fixing_date, fixing_calendar, fixing_modifier, fixing_identifier)#
Return the tenors available in the
Fixingsobject for determining an IBOR type stub period.- Parameters:
value_start_date (datetime) – The value start date of the IBOR period.
value_end_date (datetime) – The value end date of the current stub period.
fixing_date (datetime) – The index date to examine from the fixing series.
fixing_calendar (Cal, UnionCal, NamedCal,) – The calendar to derive IBOR value end dates.
fixing_modifier (Adjuster) – The date adjuster to derive IBOR value end dates.
fixing_identifier (str) – The fixing name, prior to the addition of tenor, e.g. “EUR_EURIBOR”
- Return type:
tuple of list[string tenors] and list[evaluated end dates]
- pop(name)#
Remove a timeseries from the data loader.
- Parameters:
name (str) – The string identifier for the timeseries.
- Return type:
Series[DualTypes] or None
Notes
If the
namedoes not exist None will be returned.