:orphan: :py:mod:`calliope.diff.compare` =============================== .. py:module:: calliope.diff.compare Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: calliope.diff.compare.PropertyState Functions ~~~~~~~~~ .. autoapisummary:: calliope.diff.compare.property_compare_exact calliope.diff.compare.property_compare_case_insensitive calliope.diff.compare.creator_equal calliope.diff.compare.album_equal calliope.diff.compare.song_equal calliope.diff.compare.track_equal .. py:class:: PropertyState Bases: :py:obj:`enum.Enum` Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: MISSING_BOTH :annotation: = 0 .. py:attribute:: MISSING_A :annotation: = 1 .. py:attribute:: MISSING_B :annotation: = 2 .. py:attribute:: NOT_EQUAL :annotation: = 3 .. py:attribute:: EQUAL :annotation: = 4 .. py:function:: property_compare_exact(property_name, a, b) True if ``property_name`` is present and exactly equal. .. py:function:: property_compare_case_insensitive(property_name, a, b) True if ``property_name`` is present and equal when lowercased. .. py:function:: creator_equal(a, b) True if creator (artist) of ``a`` and ``b`` are the same. Considers properties: * ``musicbrainz.artist_id`` * ``creator`` (case insensitive) .. py:function:: album_equal(a, b) True if ``a`` and ``b`` represent the same album (release group). Considers properties: * ``musicbrainz.release_group_id`` * ``musicbrainz.release_id`` * ``album`` and ``creator`` (case insensitive) .. py:function:: song_equal(a, b) True if ``a`` and ``b`` represent the same song (recording). Considers :meth:`creator_equal`, plus these properties properties: * ``identifier`` * ``musicbrainz.recording_id`` * ``title`` (case insensitive) .. py:function:: track_equal(a, b) True if ``a`` and ``b`` represent the same track on the same album. Considers :meth:`song_equal`, :meth:`album_equal`, plus these properties: * ``musicbrainz.track_id`` * ``trackNum``