pykubegrader.log_parser package#

Submodules#

pykubegrader.log_parser.parse module#

class pykubegrader.log_parser.parse.LogParser(log_lines: list[str], week_tag: str | None = None, student_info: dict[str, str] = <factory>, assignments: dict[str, dict] = <factory>)[source]#

Bases: object

A class for parsing chronological logs and extracting information. Handles both assignment info and question-level details.

assignments: dict[str, dict]#
calculate_total_scores() None[source]#

Calculates total scores for each assignment by summing the ‘score_earned’ of its questions, and sets ‘total_points’ if it was not specified.

get_results() LogParserResults[source]#

Returns the parsed results as a hierarchical dictionary with three sections:

log_lines: list[str]#
parse_logs() None[source]#

Main method to parse logs and populate student_info and assignments.

student_info: dict[str, str]#
week_tag: str | None = None#
class pykubegrader.log_parser.parse.LogParserResults[source]#

Bases: TypedDict

assignment_information: dict[str, Any]#
assignment_scores: dict[str, Any]#
assignment_type: str | None#
student_information: dict[str, str]#
week: str | None#
week_num: int | None#

Module contents#