qis.fetch_factsheet_config_kwargs

qis.fetch_factsheet_config_kwargs(factsheet_config=('B', 'B', 260, 'B', 'B', 'B', 260.0, 'QE', 260, 'B', 260, 'B', 260, 'B', None, 780, 'B', 'B', 'B', (PerfStat.Total, PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0), PerfStat.Max DD, PerfStat.Max DD/Vol, PerfStat.Skewness, PerfStat.An Alpha, PerfStat.Beta, PerfStat.R2, PerfStat.p-Alpha), (PerfStat.P.a. return, PerfStat.Vol, PerfStat.Sharpe (rf=0)), True, 'YE', 'YE', '%b-%y', 2, 2), rates_data=None, add_rates_data=True, override=None)[source]

Expand a FactsheetConfig into the keyword arguments consumed by the generate_*_factsheet(…) functions.

The FactsheetConfig fields are spread verbatim (via ._asdict()) and augmented with the two objects the generators expect to be built once: a PerfParams (constructed from the config’s frequency fields) and a BenchmarkReturnsQuantilesRegime (from freq_regime). The ‘freq’ field is popped so it does not override the per-method default frequency downstream.

Risk-free rate handling:
  • rates_data (a periodic rate series as a decimal, e.g. the 3M US T-bill) is passed straight into PerfParams and drives the excess-return / excess-Sharpe statistics.

  • if rates_data is None and add_rates_data is True, the 3M US T-bill (‘^IRX’) is downloaded via yfinance and divided by 100; if yfinance is unavailable or the download is empty (e.g. offline), rates_data falls back to None and the report uses zero-rate statistics.

  • add_rates_data also selects the displayed performance columns: the excess-return set and labels when True, the rf=0 set when False.

Parameters:
  • factsheet_config (FactsheetConfig) – the (frequency, span) preset whose fields become the report kwargs

  • rates_data (Series) – external risk-free rate series as a decimal. Supplied, it is used as-is and no download occurs

  • add_rates_data (bool) – when rates_data is None, try to download the default 3M US rate and show the excess-return columns. Warns and uses zero-rate statistics if the [data] extra is unavailable

  • override (Dict[str, Any]) – final overrides merged into the result, which win over the preset

Returns:

keyword arguments ready to spread into generate_*_factsheet(...), including the constructed perf_params and regime_classifier

Return type:

Dict[str, Any]