:py:mod:`calliope.utils` ======================== .. py:module:: calliope.utils .. autoapi-nested-parse:: Utility functions for resolving items Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: calliope.utils.FeatMode Functions ~~~~~~~~~ .. autoapisummary:: calliope.utils.normalize_creator_title calliope.utils.drop_none_values calliope.utils.parse_sort_date calliope.utils.get_nested calliope.utils.get_isrcs .. py:class:: FeatMode(*args, **kwds) Bases: :py:obj:`enum.Enum` Action to take for tracks which have "featured artists" listed. .. py:attribute:: KEEP .. py:attribute:: DROP .. py:attribute:: TO_CREATOR .. py:attribute:: TO_TITLE .. py:function:: normalize_creator_title(creator, title, feat_mode=FeatMode.TO_CREATOR) Remove featuring artists from title and append them to the artist string .. py:function:: drop_none_values(dct) Delete all fields with None value from dct. .. py:function:: parse_sort_date(date_str) Parse a potentially incomplete date string of the format YYYY-MM-DD and return a datetime.date object with conservative defaults for missing data. .. py:function:: get_nested(sequence, keys) Get the value from a nested dict/list data structure, returning None if one of the keys is invalid. .. py:function:: get_isrcs(el) Find the ISRCs of item and return them as list