genvid.toolbox.Manifest

class genvid.toolbox.Manifest

Bases: OrderedDict

class Op

Bases: Enum

An enum.Enum of the operations able to represent the difference between two manifests.

See also

difference().

Added = '+'
Updated = '*'
Deleted = '-'
Identical = '='
DiffOp

alias of tuple[Op, FileStats]

__init__(stats: Optional[Iterable[FileStats]] = None)

A class that represents a manifest in the form of a dictionary of the relative path of the file and the FileStats associated with the file.

Parameters:

stats – A sequence of FileStats to be used by the manifest.

New in version 1.42.0.

property size
difference(manifest: ManifestType, mode: SyncComparisonMode = SyncComparisonMode.Strict, *, allstats: bool = False) Iterable[tuple[genvid.toolbox.sync.Manifest.Op, genvid.toolbox.sync.FileStats]]

Compute the difference between two manifests. The difference is returned as a list of files and the associated operation to apply.

Parameters:
  • manifest – The manifest to compare to.

  • mode – comparison mode with which to identify identical files.

  • allstats – If all changes need to be returns. By default, only operations that change the files are returns.

find_match(fs: FileStats) Optional[FileStats]

Return a FileStats that matches the argument by checksum and size.

Parameters:

fs – The stats to match with.

Returns:

The stats that match or None.

class sync.Manifest

Implementation of genvid.toolbox.Manifest

class sync.ManifestType

A TypeVar for genvid.toolbox.Manifest