pyrit.analytics.analyze_results

pyrit.analytics.analyze_results#

analyze_results(attack_results: list[AttackResult]) dict[source]#

Analyze a list of AttackResult objects and return overall and grouped statistics.

Returns:

A dictionary of AttackStats objects. The overall stats are accessible with the key “Overall”, and the stats of any attack can be retrieved using “By_attack_identifier” followed by the identifier of the attack.

Raises:
  • ValueError – if attack_results is empty.

  • TypeError – if any element is not an AttackResult.

Example

>>> analyze_results(attack_results)
{
    "Overall": AttackStats,
    "By_attack_identifier": dict[str, AttackStats]
}