Skip to content

generate_report

mainsequence.virtualfundbuilder.contrib.apps.generate_report

ReportApp

Bases: BaseApp

Minimal example of a 'ReportApp' that can: 1) Generate dummy data and create charts (line + heatmap). 2) Embed those charts into an HTML template. 3) Optionally export the HTML to PDF using WeasyPrint.

run()

Generates an HTML report (and optional PDF) in a minimal, self-contained way.

ReportConfig

Bases: BaseModel

Pydantic model defining the parameters for report generation.

example_data(assets)

Fetch real data from the 'api_ts.get_df_between_dates()' call, then: 1) Build a time-series chart of 'Revenue' vs. time for each asset (ticker). 2) Build a correlation heatmap of 'Revenue' vs. 'EPS' for the latest time period. 3) Return both figures as Base64-encoded PNGs.