Skip to content

Offline and sync

sync

sync(directory: Path | str | None = None, *, url: str | None = None, token: str | None = None, training_uuid: str | None = None, keep_rejected: bool = True) -> list[SyncResult]

Send every run's reports kept on disk, or one run's with training_uuid.

What visin sync runs. Safe to repeat, and safe while an offline run is still writing: what it writes meanwhile waits for the next sync. A second sync started while one is running over the same directory raises :class:~visin.errors.SyncInProgressError instead of sending anything.

pending

pending(directory: Path | str | None = None) -> dict[str, int]

Runs with reports waiting on disk, and how many each, oldest run first.

SyncResult dataclass

SyncResult(training_uuid: str, sent: int = 0, rejected: list[str] = list(), remaining: int = 0, kept_rejected: int = 0)

What one run's sync achieved.