from dataclasses import dataclass from pathlib import Path from typing import Iterable, Optional, Tuple @dataclass(frozen=True) class ScanConfig: """Read-only paths used for one library scan.""" serato: Path music: Path out: Path report: Path reference_roots: Tuple[Path, ...] = () verbose: bool = False log_file: Optional[Path] = None @classmethod def build( cls, serato: Path, music: Path, out: Path, report: Path, reference_roots: Iterable[Path] = (), verbose: bool = False, log_file: Optional[Path] = None, ) -> "ScanConfig": return cls( serato, music, out, report, tuple(reference_roots), verbose, log_file, )