Changeset View
Changeset View
Standalone View
Standalone View
swh/dataset/cli.py
# Copyright (C) 2020 The Software Heritage developers | # Copyright (C) 2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
# WARNING: do not import unnecessary things here to keep cli startup time under | # WARNING: do not import unnecessary things here to keep cli startup time under | ||||
# control | # control | ||||
import os | import os | ||||
import pathlib | import pathlib | ||||
import click | import click | ||||
from swh.core.cli import CONTEXT_SETTINGS | from swh.core.cli import CONTEXT_SETTINGS | ||||
from swh.core.cli import swh as swh_cli_group | from swh.core.cli import swh as swh_cli_group | ||||
from swh.dataset.exporters.edges import GraphEdgesExporter | from swh.dataset.exporters.edges import GraphEdgesExporter | ||||
from swh.dataset.exporters.orc import ORCExporter | |||||
from swh.dataset.journalprocessor import ParallelJournalProcessor | from swh.dataset.journalprocessor import ParallelJournalProcessor | ||||
@swh_cli_group.group(name="dataset", context_settings=CONTEXT_SETTINGS) | @swh_cli_group.group(name="dataset", context_settings=CONTEXT_SETTINGS) | ||||
@click.option( | @click.option( | ||||
"--config-file", | "--config-file", | ||||
"-C", | "-C", | ||||
default=None, | default=None, | ||||
Show All 14 Lines | |||||
@click.pass_context | @click.pass_context | ||||
def graph(ctx): | def graph(ctx): | ||||
"""Manage graph export""" | """Manage graph export""" | ||||
pass | pass | ||||
AVAILABLE_EXPORTERS = { | AVAILABLE_EXPORTERS = { | ||||
"edges": GraphEdgesExporter, | "edges": GraphEdgesExporter, | ||||
"orc": ORCExporter, | |||||
} | } | ||||
@graph.command("export") | @graph.command("export") | ||||
@click.argument("export-path", type=click.Path()) | @click.argument("export-path", type=click.Path()) | ||||
@click.option("--export-id", "-e", help="Unique ID of the export run.") | @click.option("--export-id", "-e", help="Unique ID of the export run.") | ||||
@click.option( | @click.option( | ||||
"--formats", | "--formats", | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |