Skip to content

I/O

Excel exporter

fantasyfb.io.excel_exporter.FantasyExcelExporter

FantasyExcelExporter(output_path: str)

Handles Excel export with formatting for fantasy football data.

Initialize Excel writer and formatting.

Parameters:

Name Type Description Default
output_path str

Full path to output Excel file

required

export_rosters

export_rosters(rosters_df: DataFrame)

Export rosters with WAR conditional formatting.

export_available

export_available(available_df: DataFrame)

Export available players with WAR conditional formatting.

export_schedule

export_schedule(schedule_df: DataFrame)

Export schedule with win probability formatting.

export_standings

export_standings(standings_df: DataFrame)

Export standings with playoff probability formatting.

export_analysis

export_analysis(data_df: DataFrame, sheet_name: str, freeze_cols: int = 1)

Export analysis results (pickups, adds, drops, trades).

export_deltas

export_deltas(deltas_df: DataFrame)

Export per-game deltas with full conditional formatting.

close

close()

Close the Excel writer.

HTML exporter

fantasyfb.io.html_exporter.FantasyHtmlExporter

FantasyHtmlExporter(output_path: str, week: int, me: str, sims: Optional[int] = None, day: Optional[str] = None, platform: str = 'Yahoo', bestball: bool = False, drop_safe_threshold: float = -4.0, drop_depth_threshold: float = -12.0)

Collects fantasy football DataFrames and writes one interactive HTML report.

Parameters:

Name Type Description Default
output_path str

Full path to the output .html file

required
week int

Current NFL week

required
me str

Name of the user's own fantasy team (the report's default view)

required
sims Optional[int]

Number of Monte Carlo simulations behind the numbers

None
day Optional[str]

Weekday label shown in the header (e.g. "Wednesday")

None
platform str

Fantasy platform name shown in the footer

'Yahoo'
bestball bool

Whether the report is for a best ball run

False
drop_safe_threshold float

A drop whose expected-earnings delta is above this value gets the "Safe to cut" verdict

-4.0
drop_depth_threshold float

Above this (but not above the safe threshold) gets "Depth"; anything lower is "Keep"

-12.0

export_rosters

export_rosters(rosters_df: DataFrame)

Collect rostered players.

export_available

export_available(available_df: DataFrame)

Collect available (free agent) players.

export_schedule

export_schedule(schedule_df: DataFrame)

Collect the simulated league schedule.

export_standings

export_standings(standings_df: DataFrame)

Collect simulated standings.

export_analysis

export_analysis(data_df: DataFrame, sheet_name: str, freeze_cols: int = 1)

Collect an analysis table ("Adds", "Pickups", "Drops" or "Trades").

freeze_cols is accepted for signature parity with the Excel exporter and ignored.

export_deltas

export_deltas(deltas_df: DataFrame)

Collect per-game deltas (the --deltas rooting guide).

deltas_df is the frame returned by League.perGameDelta: one row per hypothetical winner (winner column), one column per team holding that team's change in expected earnings if that winner wins.

render

render() -> str

Render the report to an HTML string.

close

close()

Write the HTML file.