openavmkit.reports
MarkdownReport
MarkdownReport(name)
A report generator that uses a Markdown template.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the report, corresponding to a Markdown template. |
template |
str
|
The raw Markdown template text. |
rendered |
str
|
The rendered Markdown text after variable substitution. |
variables |
dict
|
Dictionary of variables for substitution in the template. |
Initialize the MarkdownReport by loading the Markdown template.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the report template (without file extension). |
required |
Source code in openavmkit/reports.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
get_var
get_var(key)
Get the value of a variable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
Variable key. |
required |
Returns:
Type | Description |
---|---|
Any or None
|
The value associated with |
Source code in openavmkit/reports.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
render
render()
Render the report by substituting variables in the template.
Returns:
Type | Description |
---|---|
str
|
The rendered Markdown text with all variables replaced. |
Source code in openavmkit/reports.py
90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
set_var
set_var(key, value, fmt=None)
Set a variable value with optional formatting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
Variable key. |
required |
value
|
Any
|
Value to be set. |
required |
fmt
|
str
|
Format string to apply to |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in openavmkit/reports.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
finish_report
finish_report(report, outpath, css_file, settings)
Render the report and export it in Markdown, HTML, and PDF formats.
Saves the rendered Markdown to disk and converts it to target formats using a specified CSS file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report
|
MarkdownReport
|
MarkdownReport object to be finished. |
required |
outpath
|
str
|
Output file path (without extension). |
required |
css_file
|
str
|
Name of the CSS file (without extension) to style the report. |
required |
settings
|
dict
|
Settings dictionary. |
required |
Source code in openavmkit/reports.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
start_report
start_report(report_name, settings, model_group)
Create and initialize a MarkdownReport with basic variables set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_name
|
str
|
Name of the report template. |
required |
settings
|
dict
|
Settings dictionary. |
required |
model_group
|
str
|
Model group identifier. |
required |
Returns:
Type | Description |
---|---|
MarkdownReport
|
Initialized MarkdownReport object. |
Source code in openavmkit/reports.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|