imgsorter

A library for sorting and grouping images and videos.

Classes:

SortMode(value)

enum.Enum of the sorting mode -- whether to move the images or only copy them.

Functions:

sort_images(destination, *source[, ...])

Sort all images in *source into destination.

enum SortMode(value)[source]

Bases: enum_tools.custom_enums.StrEnum

enum.Enum of the sorting mode – whether to move the images or only copy them.

Member Type

str

Valid values are as follows:

MODE_MOVE = <SortMode.MODE_MOVE: 'move'>
MODE_COPY = <SortMode.MODE_COPY: 'copy'>
sort_images(destination, *source, known_cameras=None, mode=SortMode.MODE_COPY)[source]

Sort all images in *source into destination.

Parameters
  • destination (Union[str, Path, PathLike])

  • *source (Union[str, Path, PathLike])

  • known_cameras (Optional[Dict[str, str]]) – A mapping of camera IDs – as listed in the image metadata – to human-readable names. For example, VKY-L09 might map to Smartphone. Default None.

  • mode (SortMode) – The sorting mode – whether to move the images or only copy them. Default <SortMode.MODE_COPY: 'copy'>.

Return type

Dict[str, List[PathPlus]]