swh.scanner.scanner module#

class swh.scanner.scanner.Progress(step: Step, total: int | None = None, **kwargs)[source]#

Bases: object

default no-op Progress class

class Step(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

DISK_SCAN = 1#
KNOWN_DISCOVERY = 2#
PROVENANCE = 3#
increment(count=1)[source]#
update(current_count, total=None)[source]#
swh.scanner.scanner.get_webapi_client(config: Dict[str, Any])[source]#
swh.scanner.scanner.run(config: ~typing.Dict[str, ~typing.Any], policy, source_tree: ~swh.model.from_disk.Directory, nodes_data: ~swh.scanner.data.MerkleNodeInfo, provenance: bool, progress_class: ~typing.Type[~swh.scanner.scanner.Progress] = <class 'swh.scanner.scanner.Progress'>) WebAPIClient[source]#

Scan a given source code according to the policy given in input.

swh.scanner.scanner.scan(config: Dict[str, Any], root_path: str, out_fmt: str, interactive: bool, provenance: bool, debug_http: bool, progress_class: Type[Progress])[source]#

Scan a source code project to discover files and directories already present in the archive