grouper#

s3manifesto.grouper.group_files(files: List[Tuple[str, int]], target: int, sort_by_target: bool = True) List[Tuple[List[Tuple[str, int]], int]][source]#

Given a list of File and a target size, put them into groups, so that each group has approximately the same size as the target size.

Parameters:
  • files – List of files to be grouped

  • target – Target size or target n_record for each group