mythx_cli.formatter package

mythx_cli.formatter.base

This module contains the base formatter interface.

class mythx_cli.formatter.base.BaseFormatter[source]

Bases: abc.ABC

The base formatter interface for printing various response types.

static format_analysis_list(obj: mythx_models.response.analysis_list.AnalysisListResponse) → str[source]

Format an analysis list response.

static format_analysis_status(resp: mythx_models.response.analysis_status.AnalysisStatusResponse) → str[source]

Format an analysis status response.

static format_detected_issues(issues_list: List[Tuple[mythx_models.response.detected_issues.DetectedIssuesResponse, Optional[mythx_models.response.analysis_input.AnalysisInputResponse]]], **kwargs) → str[source]

Format an issue report response.

static format_version(obj: mythx_models.response.version.VersionResponse) → str[source]

Format a version response.

report_requires_input = False

mythx_cli.formatter.json

This module contains the compressed and pretty-printing JSON formatters.

class mythx_cli.formatter.json.JSONFormatter[source]

Bases: mythx_cli.formatter.base.BaseFormatter

The JSON formatter.

It returns string-encoded JSON objects and does not require the analysis input to generate payloads.

static format_analysis_list(resp: mythx_models.response.analysis_list.AnalysisListResponse) → str[source]

Format an analysis list response as compressed JSON.

static format_analysis_status(resp: mythx_models.response.analysis_status.AnalysisStatusResponse) → str[source]

Format an analysis status response as compressed JSON.

static format_detected_issues(issues_list: List[Tuple[mythx_models.response.detected_issues.DetectedIssuesResponse, Optional[mythx_models.response.analysis_input.AnalysisInputResponse]]], **kwargs) → str[source]

Format an issue report response as compressed JSON.

static format_group_list(resp: mythx_models.response.group_list.GroupListResponse) → str[source]

Format a group list response as compressed JSON.

static format_group_status(resp: mythx_models.response.group_status.GroupStatusResponse) → str[source]

Format a group status response as compressed JSON.

static format_version(resp: mythx_models.response.version.VersionResponse) → str[source]

Format a version response as compressed JSON.

report_requires_input = False
class mythx_cli.formatter.json.PrettyJSONFormatter[source]

Bases: mythx_cli.formatter.base.BaseFormatter

The pretty-printing JSON formatter.

It works exactly as the JSON formatter, with the difference that the string- encoded JSON object is indented with two spaces for each level, and the keys are sorted in alphabetical order.

static format_analysis_list(obj: mythx_models.response.analysis_list.AnalysisListResponse) → str[source]

Format an analysis list response as pretty-printed JSON.

static format_analysis_status(obj: mythx_models.response.analysis_status.AnalysisStatusResponse) → str[source]

Format an analysis status response as pretty-printed JSON.

static format_detected_issues(issues_list: List[Tuple[mythx_models.response.detected_issues.DetectedIssuesResponse, Optional[mythx_models.response.analysis_input.AnalysisInputResponse]]], **kwargs) → str[source]

Format an issue report response as pretty-printed JSON.

static format_group_list(resp: mythx_models.response.group_list.GroupListResponse) → str[source]

Format a group list response as pretty-printed JSON.

static format_group_status(resp: mythx_models.response.group_status.GroupStatusResponse) → str[source]

Format a group status response as pretty-printed JSON.

static format_version(obj: mythx_models.response.version.VersionResponse) → str[source]

Format a version response as pretty-printed JSON.

report_requires_input = False

mythx_cli.formatter.simple_stdout

mythx_cli.formatter.tabular

mythx_cli.formatter.util