quark.webreport package
Submodules
quark.webreport.generate module
- class quark.webreport.generate.ReportGenerator(json_report)
Bases:
object
This module is for web report generating.
- get_analysis_report_html()
Load the quark JSON report and generate the HTML of the Quark web report.
- Returns:
the string of Quark web report HTML
- get_rule_generate_editor_html()
Load the rule generation result and generate the HTML of the Quark web report.
- Returns:
the string of Quark web report HTML
- insert_genrule_report_html(data, filename, md5, filesize, rule_number)
Generate the HTML of rule generation result secton.
- Parameters:
data – the dict of rule generation result
- insert_radarchart_html(five_stages_labels, all_labels)
Generate the HTML of radar chart secton in Quark web report.
- Parameters:
five_stages_labels – the set of lebels
with 100% confidence crimes :param all_labels: the set contain all labels with crimes above 0% confidence
- insert_report_html(data)
Generate the HTML of summary report secton in Quark web report.
- Parameters:
data – the dict of Quark JSON report
- insert_sample_information_html(rules_number_set, filename, md5, filesize, labels)
Generate the HTML of sample information secton in Quark web report.
- Parameters:
rules_number_set – the dict of rule number
for each confidence :param filename: the string of the sample filename :param md5: the string of the sample md5 hash value :param filesize: the string of the sample filesize :param labels: the set of lebels with 100% confidence crimes
- quark.webreport.generate.count_confidence_rule_number(data, confidence)
Get the number of rules with given confidence in JSON report.
- Parameters:
data – the dict of Quark JSON report
confidence – the string of given confidence
- Returns:
the int for the number of rules
with given confidence in JSON report
- quark.webreport.generate.get_all_labels(data)
Get all labels with crimes above 0% confidence.
- Parameters:
data – the dict of Quark JSON report
- Returns:
the set contain all labels with crimes above 0% confidence
- quark.webreport.generate.get_five_stages_labels(data)
Get the labels with 100% confidence crimes.
- Parameters:
data – the dict of Quark JSON report
- Returns:
the set contain all lebels with 100% confidence crimes
- quark.webreport.generate.get_json_report_html(layout, data)
Convert the quark JSON report to HTML with script tag.
- Parameters:
data – the dict of Quark JSON report
- Returns:
the string of Quark JSON report HTML