def summary_parser()

in pageload-summary/summarize.py [0:0]


def summary_parser():
    parser = argparse.ArgumentParser(
        "This tool can be used to generate a summary of the pageload numbers for a single "
        "given subtest, i.e. ContenfulSpeedIndex. We provide the summary through a geomean "
        "and you can also perform a comparison with competing browsers using "
        "`--compare-browsers`. You must provide data in the CSV format that is returned from "
        "this query: https://sql.telemetry.mozilla.org/queries/79289"
    )
    parser.add_argument(
        "data", metavar="CSV_DATA", type=str, help="The data to summarize."
    )
    parser.add_argument(
        "--timespan",
        type=int,
        default=24,
        help="Minimum time between each data point in hours.",
    )
    parser.add_argument(
        "--moving-average-window",
        type=int,
        default=7,
        help="Number of days to use for the moving average.",
    )
    parser.add_argument(
        "--by-site",
        action="store_true",
        default=False,
        help="Output summary by site",
    )
    parser.add_argument(
        "--visualize",
        action="store_true",
        default=False,
        help="Show visualizations",
    )
    parser.add_argument(
        "--save-plots",
        action="store_true",
        default=False,
        help="Save visualizations",
    )
    parser.add_argument(
        "--save-directory",
        help="Directory to save visualizations",
    )
    parser.add_argument(
        "--platforms",
        nargs="*",
        default=[],
        help="Platforms to summarize. Default is all platforms.",
    )
    parser.add_argument(
        "--platform-pattern",
        help="pattern (substring-match) for platforms to summarize. Default is all platforms.",
    )
    parser.add_argument(
        "--start-date",
        type=datetime.datetime.fromisoformat,
        help="Date to start analysis (inclusive).",
    )
    parser.add_argument(
        "--end-date",
        type=datetime.datetime.fromisoformat,
        help="Date to end analysis (inclusive).",
    )
    parser.add_argument(
        "--apps",
        nargs="*",
        default=[],
        help="Apps to summarize (default is all).  Examples: firefox, chromium, chrome",
    )
    parser.add_argument(
        "--output",
        type=str,
        default=os.getcwd(),
        help="This is where the data will be saved in JSON format. If the "
        "path has a `.json` suffix then we'll use the part immediately "
        "before it as the file name.",
    )
    return parser