Collection

class pysmith.contrib.core.collection.Collection(*, collection_name, match_pattern, order_by, reverse=False)[source]

Creates ordered collections of files. Collections are sorted lists of FileInfo objects that are stored in a dictionary (using the provided name as a key) in the build info metadata under the key collections.

Parameters
  • collection_name (str) – The name of the collection.

  • match_pattern (str) – The pattern of files to build the collection from.

  • order_by (str or func(FileInfo)) – The function to use when sorting the collection. If this is a string, it will be used as the key to look up the value to order by in the file’s metadata. If this is a function, it will be executed to find the value to order by.

  • reverse (bool) – If this parameter is true, the collection will be sorted in reverse order.