calliope.diff.compare

Module Contents

Classes

PropertyState

Generic enumeration.

Functions

property_compare_exact(property_name, a, b)

True if property_name is present and exactly equal.

property_compare_case_insensitive(property_name, a, b)

True if property_name is present and equal when lowercased.

creator_equal(a, b)

True if creator (artist) of a and b are the same.

album_equal(a, b)

True if a and b represent the same album (release group).

song_equal(a, b)

True if a and b represent the same song (recording).

track_equal(a, b)

True if a and b represent the same track on the same album.

class calliope.diff.compare.PropertyState

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

MISSING_BOTH = 0
MISSING_A = 1
MISSING_B = 2
NOT_EQUAL = 3
EQUAL = 4
calliope.diff.compare.property_compare_exact(property_name, a, b)

True if property_name is present and exactly equal.

Parameters
Return type

PropertyState

calliope.diff.compare.property_compare_case_insensitive(property_name, a, b)

True if property_name is present and equal when lowercased.

Parameters
Return type

PropertyState

calliope.diff.compare.creator_equal(a, b)

True if creator (artist) of a and b are the same.

Considers properties:

  • musicbrainz.artist_id

  • creator (case insensitive)

Parameters
calliope.diff.compare.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)

Parameters
calliope.diff.compare.song_equal(a, b)

True if a and b represent the same song (recording).

Considers creator_equal(), plus these properties properties:

  • identifier

  • musicbrainz.recording_id

  • title (case insensitive)

Parameters
calliope.diff.compare.track_equal(a, b)

True if a and b represent the same track on the same album.

Considers song_equal(), album_equal(), plus these properties:

  • musicbrainz.track_id

  • trackNum

Parameters