kailo_beewell_dashboard.summary_rag

Helper functions for the summary page, and for the production of the ‘RAG’ boxes which are also use on the ‘Explore Results’ page

Module Contents

Functions

create_rag_container(text, background, font[, output, key])

Generates a streamlit or HTML container with the specified background and

result_box(rag[, output])

Creates a result box with the RAG rating

rag_intro_column(rag, rag_descrip[, output])

Generate a row for the introduction to the summary section, with a RAG

summary_intro(school_size[, output])

Creates the introduction for the summary section

summary_table(df_scores, chosen_group, chosen_school)

Produce the summary RAG table using rows and columns, for streamlit page

kailo_beewell_dashboard.summary_rag.create_rag_container(text, background, font, output='streamlit', key=None)

Generates a streamlit or HTML container with the specified background and font colours, including the text provided, and with class of ‘result_box’ if its the HTML container

Parameters

textstring

Text to go in the container.

backgroundstring

Background colour.

fontstring

Font colour.

outputstring

Specifies whether to write for ‘streamlit’ (default) or ‘pdf’.

keystring

Optional input. Key for the container.

Returns

html_stringstring

HTML string, to be appended to the content for the report

kailo_beewell_dashboard.summary_rag.result_box(rag, output='streamlit')

Creates a result box with the RAG rating

Parameters

ragstring

Result from comparison with other schools - either ‘below’, ‘average’, ‘above’, or np.nan

outputstring

Specifies whether to write for ‘streamlit’ (default) or ‘pdf’.

Returns

html_stringstring

HTML string, to be appended to the content for the report

kailo_beewell_dashboard.summary_rag.rag_intro_column(rag, rag_descrip, output='streamlit')

Generate a row for the introduction to the summary section, with a RAG box and description of that box across 2 columns.

Parameters

ragstring

RAG performance - either ‘above’, ‘average’, ‘below’, or np.nan

rag_descripstring

Description of the RAG rating

outputstring

Specifies whether to write for ‘streamlit’ (default) or ‘pdf’.

Returns

html_stringstring

Section of HTML that creates the RAG introductory columns

kailo_beewell_dashboard.summary_rag.summary_intro(school_size, output='streamlit')

Creates the introduction for the summary section

Parameters

school_sizeinteger

Total number of pupils at school (who answered at least one question)

outputstring

Specifies whether to write for ‘streamlit’ (default) or ‘pdf’

Returns

html_stringstring

Optional return, if output==’pdf’, contains HTML for summary cover page

kailo_beewell_dashboard.summary_rag.summary_table(df_scores, chosen_group, chosen_school, output='streamlit', content=None)

Produce the summary RAG table using rows and columns, for streamlit page or PDF report.

Parameters

df_scoresdataframe

Dataframe containing the RAG ratings for each topic for each school

chosen_groupstring

The group for results to be viewed by - one of: ‘For all pupils’, ‘By year group’, ‘By gender’, ‘By FSM’, or ‘By SEN’

chosen_schoolstring

Name of chosen school

outputstring

Specifies whether to write for ‘streamlit’ (default) or ‘pdf’

contentlist

Optional input used when output==’pdf’, contains HTML for report.

Returns

contentlist

Optional return, used when output==’pdf’, contains HTML for report.