pdstools.utils.report_utils

Attributes

Functions

_get_cmd_output(→ List[str])

Get command output in an OS-agnostic way.

_get_version_only(→ str)

Extract version number from version string.

get_quarto_with_version(→ Tuple[pathlib.Path, str])

Get Quarto executable path and version.

get_pandoc_with_version(→ Tuple[pathlib.Path, str])

Get Pandoc executable path and version.

quarto_print(text)

quarto_callout_info(info)

quarto_callout_important(info)

quarto_plot_exception(plot_name, e)

quarto_callout_no_prediction_data_warning([extra])

quarto_callout_no_predictor_data_warning([extra])

polars_col_exists(df, col)

polars_subset_to_existing_cols(all_columns, cols)

rag_background_styler([rag])

rag_background_styler_dense([rag])

rag_textcolor_styler([rag])

table_standard_formatting(source_table[, title, ...])

table_style_predictor_count(gt, flds[, ...])

n_unique_values(dm, all_dm_cols, fld)

max_by_hierarchy(dm, all_dm_cols, fld, grouping)

avg_by_hierarchy(dm, all_dm_cols, fld, grouping)

sample_values(dm, all_dm_cols, fld[, n])

show_credits(quarto_source)

_serialize_query(→ Optional[Dict])

Module Contents

logger
_get_cmd_output(args: List[str]) List[str]

Get command output in an OS-agnostic way.

Parameters:

args (List[str])

Return type:

List[str]

_get_version_only(versionstr: str) str

Extract version number from version string.

Parameters:

versionstr (str)

Return type:

str

get_quarto_with_version(verbose: bool = True) Tuple[pathlib.Path, str]

Get Quarto executable path and version.

Parameters:

verbose (bool)

Return type:

Tuple[pathlib.Path, str]

get_pandoc_with_version(verbose: bool = True) Tuple[pathlib.Path, str]

Get Pandoc executable path and version.

Parameters:

verbose (bool)

Return type:

Tuple[pathlib.Path, str]

quarto_print(text)
quarto_callout_info(info)
quarto_callout_important(info)
quarto_plot_exception(plot_name: str, e: Exception)
Parameters:
quarto_callout_no_prediction_data_warning(extra='')
quarto_callout_no_predictor_data_warning(extra='')
polars_col_exists(df, col)
polars_subset_to_existing_cols(all_columns, cols)
rag_background_styler(rag: str | None = None)
Parameters:

rag (Optional[str])

rag_background_styler_dense(rag: str | None = None)
Parameters:

rag (Optional[str])

rag_textcolor_styler(rag: str | None = None)
Parameters:

rag (Optional[str])

table_standard_formatting(source_table, title=None, subtitle=None, rowname_col=None, groupname_col=None, cdh_guidelines=CDHGuidelines(), highlight_limits: Dict[str, str | List[str]] = {}, highlight_lists: Dict[str, List[str]] = {}, highlight_configurations: List[str] = [], rag_styler: callable = rag_background_styler)
Parameters:
  • highlight_limits (Dict[str, Union[str, List[str]]])

  • highlight_lists (Dict[str, List[str]])

  • highlight_configurations (List[str])

  • rag_styler (callable)

table_style_predictor_count(gt: great_tables.GT, flds, cdh_guidelines=CDHGuidelines(), rag_styler=rag_textcolor_styler)
Parameters:

gt (great_tables.GT)

n_unique_values(dm, all_dm_cols, fld)
max_by_hierarchy(dm, all_dm_cols, fld, grouping)
avg_by_hierarchy(dm, all_dm_cols, fld, grouping)
sample_values(dm, all_dm_cols, fld, n=6)
show_credits(quarto_source: str)
Parameters:

quarto_source (str)

_serialize_query(query: pdstools.utils.types.QUERY | None) Dict | None
Parameters:

query (Optional[pdstools.utils.types.QUERY])

Return type:

Optional[Dict]