:py:mod:`calliope.select` ========================= .. py:module:: calliope.select .. autoapi-nested-parse:: Select tracks for a playlist based on a set of constraints. This module was inspired by the 2008 paper `Music playlist generation by adapted simulated annealing `_ (S. Pauws, W. Verhaegh, M. Vossen). See :mod:`calliope.select.constraints` for details of the constraints. Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: calliope.select.constraint_from_string calliope.select.select .. py:exception:: SelectError Bases: :py:obj:`Exception` Exception returned from :mod:`calliope.select` module. Initialize self. See help(type(self)) for accurate signature. .. py:exception:: ConstraintStringParseError Bases: :py:obj:`SelectError` Error returned by :func:`constraint_from_string`. Initialize self. See help(type(self)) for accurate signature. .. py:function:: constraint_from_string(text) .. py:function:: select(playlist, constraints) Select music from input playlist according to a set of constraints. A simple constraint solving algorithm is used to produce a playlist. This involves some random choices, which may produce different results each time the function is called unless the same random seed is used. See also: :command:`cpe select`. :param playlist: input songs (order isn't important) :param constraints: one or more Constraint instances :returns: A playlist that satisfies the constraints.