Musify

📜 How to...

  • Installation
  • Load a local library and objects
    • Set up logging
    • Create a library object
    • Load your library and other objects
  • Create, load, and update a local playlist
    • Set up logging
    • Create a playlist
    • Load a playlist
    • Modify and save the playlist
  • Load and save tags to a local track
    • Set up logging
    • Load a track
    • Modify the track’s tags and save them
  • Load a Spotify library and objects
    • Set up logging
    • Set up the Spotify API
    • Load your library
  • Backup and restore your library data
    • Set up logging
    • Backup and restore a local library
    • Backup and restore a remote library
  • Sync data between local and remote libraries
    • Set up logging
    • Sync data
  • Create a playlist of your followed artists’ latest music
    • Set up logging
    • Create the playlist
  • Get useful stats about your libraries
    • Set up logging
    • Report on differences in playlists
    • Report on missing tags

🛠️ Project Info

  • Release History
    • 1.2.5
      • Fixed
    • 1.2.5
      • Fixed
    • 1.2.4
      • Fixed
    • 1.2.3
      • Changed
    • 1.2.2
      • Changed
    • 1.2.1
      • Changed
      • Fixed
    • 1.2.0
      • Added
      • Changed
      • Fixed
    • 1.1.10
      • Fixed
    • 1.1.9
      • Changed
      • Fixed
    • 1.1.8
      • Fixed
    • 1.1.7
      • Fixed
    • 1.1.6
      • Fixed
    • 1.1.5
      • Fixed
    • 1.1.4
      • Added
      • Changed
    • 1.1.3
      • Fixed
    • 1.1.2
      • Changed
    • 1.1.1
      • Changed
    • 1.1.0
      • Changed
      • Removed
      • Documentation
    • 1.0.2
      • Added
      • Removed
      • Fixed
    • 1.0.1
      • Documentation
    • 1.0.0
      • Added
      • Changed
      • Fixed
      • Removed
      • Documentation
    • 0.9.2
      • Added
      • Changed
      • Documentation
      • Fixed
    • 0.9.1
      • Fixed
    • 0.9.0
      • Added
      • Changed
      • Fixed
      • Removed
      • Documentation
    • 0.8.1
      • Changed
      • Documentation
      • Fixed
      • Removed
    • 0.8.0
      • Added
      • Changed
      • Removed
      • Fixed
    • 0.7.6
      • Fixed
    • 0.7.5
      • Added
      • Changed
      • Fixed
      • Documentation
    • 0.7.4
      • Fixed
      • Documentation
    • 0.7.3
      • Changed
      • Fixed
    • 0.7.2
      • Fixed
    • 0.7.1
      • Changed
      • Fixed
    • 0.7.0
  • Contributing
    • Setup your development environment
    • Making changes and testing
    • Submitting your changes for review
  • Licence

📖 Reference

  • File
    • Base
      • File
        • File.valid_extensions
        • File.path
        • File.folder
        • File.filename
        • File.ext
        • File.size
        • File.date_created
        • File.date_modified
        • File.get_filepaths()
        • File.load()
        • File.save()
    • Exceptions
      • FileError
      • InvalidFileType
      • FileDoesNotExistError
      • UnexpectedPathError
      • ImageLoadError
    • Image
      • open_image()
      • get_image_bytes()
    • Path Mapper
      • PathMapper
        • PathMapper.map()
        • PathMapper.map_many()
        • PathMapper.unmap()
        • PathMapper.unmap_many()
        • PathMapper.as_dict()
      • PathStemMapper
        • PathStemMapper.stem_unmap
        • PathStemMapper.stem_map
        • PathStemMapper.available_paths
        • PathStemMapper.map()
        • PathStemMapper.unmap()
        • PathStemMapper.as_dict()
  • Libraries
    • Core
      • Collection
        • ItemGetterStrategy
          • ItemGetterStrategy.key
          • ItemGetterStrategy.name
          • ItemGetterStrategy.get_value_from_item()
          • ItemGetterStrategy.get_item()
        • NameGetter
          • NameGetter.name
          • NameGetter.get_value_from_item()
        • PathGetter
          • PathGetter.name
          • PathGetter.get_value_from_item()
        • RemoteIDGetter
          • RemoteIDGetter.name
          • RemoteIDGetter.get_value_from_item()
        • RemoteURIGetter
          • RemoteURIGetter.name
          • RemoteURIGetter.get_value_from_item()
        • RemoteURLAPIGetter
          • RemoteURLAPIGetter.name
          • RemoteURLAPIGetter.get_value_from_item()
        • RemoteURLEXTGetter
          • RemoteURLEXTGetter.name
          • RemoteURLEXTGetter.get_value_from_item()
        • MusifyCollection
          • MusifyCollection.items
          • MusifyCollection.length
          • MusifyCollection.count()
          • MusifyCollection.index()
          • MusifyCollection.copy()
          • MusifyCollection.append()
          • MusifyCollection.extend()
          • MusifyCollection.insert()
          • MusifyCollection.remove()
          • MusifyCollection.pop()
          • MusifyCollection.reverse()
          • MusifyCollection.clear()
          • MusifyCollection.sort()
          • MusifyCollection.intersection()
          • MusifyCollection.difference()
          • MusifyCollection.outer_difference()
          • MusifyCollection.as_dict()
      • Object
        • Track
          • Track.kind
          • Track.name
          • Track.title
          • Track.artist
          • Track.artists
          • Track.album
          • Track.album_artist
          • Track.track_number
          • Track.track_total
          • Track.genres
          • Track.date
          • Track.year
          • Track.month
          • Track.day
          • Track.bpm
          • Track.key
          • Track.disc_number
          • Track.disc_total
          • Track.compilation
          • Track.comments
          • Track.image_links
          • Track.has_image
          • Track.length
          • Track.rating
        • Playlist
          • Playlist.kind
          • Playlist.name
          • Playlist.description
          • Playlist.items
          • Playlist.tracks
          • Playlist.track_total
          • Playlist.image_links
          • Playlist.has_image
          • Playlist.length
          • Playlist.date_created
          • Playlist.date_modified
          • Playlist.merge()
        • Library
          • Library.name
          • Library.source
          • Library.items
          • Library.length
          • Library.tracks
          • Library.track_total
          • Library.tracks_in_playlists
          • Library.playlists
          • Library.load()
          • Library.load_tracks()
          • Library.log_tracks()
          • Library.load_playlists()
          • Library.log_playlists()
          • Library.merge_playlists()
        • Folder
          • Folder.name
          • Folder.folder
          • Folder.items
          • Folder.tracks
          • Folder.artists
          • Folder.albums
          • Folder.track_total
          • Folder.genres
          • Folder.compilation
          • Folder.length
        • Album
          • Album.kind
          • Album.name
          • Album.items
          • Album.album
          • Album.tracks
          • Album.artist
          • Album.artists
          • Album.album_artist
          • Album.track_total
          • Album.genres
          • Album.date
          • Album.year
          • Album.month
          • Album.day
          • Album.disc_total
          • Album.compilation
          • Album.image_links
          • Album.has_image
          • Album.length
          • Album.rating
        • Artist
          • Artist.kind
          • Artist.name
          • Artist.items
          • Artist.artist
          • Artist.tracks
          • Artist.artists
          • Artist.albums
          • Artist.track_total
          • Artist.genres
          • Artist.length
          • Artist.rating
        • Genre
          • Genre.name
          • Genre.items
          • Genre.genre
          • Genre.tracks
          • Genre.artists
          • Genre.albums
          • Genre.related_genres
          • Genre.length
    • Local
      • Library
        • Library
          • LocalLibrary
            • LocalLibrary.name
            • LocalLibrary.source
            • LocalLibrary.tracks
            • LocalLibrary.playlists
            • LocalLibrary.folders
            • LocalLibrary.albums
            • LocalLibrary.artists
            • LocalLibrary.genres
            • LocalLibrary.path_mapper
            • LocalLibrary.library_folders
            • LocalLibrary.playlist_filter
            • LocalLibrary.playlist_folder
            • LocalLibrary.errors
            • LocalLibrary.load()
            • LocalLibrary.load_track()
            • LocalLibrary.load_tracks()
            • LocalLibrary.log_tracks()
            • LocalLibrary.load_playlist()
            • LocalLibrary.load_playlists()
            • LocalLibrary.log_playlists()
            • LocalLibrary.save_playlists()
            • LocalLibrary.merge_playlists()
            • LocalLibrary.restore_tracks()
            • LocalLibrary.json()
        • Musicbee
          • MusicBee
            • MusicBee.valid_extensions
            • MusicBee.xml_library_path
            • MusicBee.xml_library_path_keys
            • MusicBee.xml_settings_path
            • MusicBee.playlists_path
            • MusicBee.path
            • MusicBee.musicbee_folder
            • MusicBee.library_xml
            • MusicBee.settings_xml
            • MusicBee.load_tracks()
            • MusicBee.save()
            • MusicBee.generate_persistent_id()
            • MusicBee.track_to_xml()
            • MusicBee.playlist_to_xml()
          • XMLLibraryParser
            • XMLLibraryParser.timestamp_format
            • XMLLibraryParser.path
            • XMLLibraryParser.path_keys
            • XMLLibraryParser.to_xml_timestamp()
            • XMLLibraryParser.from_xml_timestamp()
            • XMLLibraryParser.to_xml_path()
            • XMLLibraryParser.from_xml_path()
            • XMLLibraryParser.parse()
            • XMLLibraryParser.unparse()
      • Playlist
        • Base
          • LocalPlaylist
            • LocalPlaylist.name
            • LocalPlaylist.tracks
            • LocalPlaylist.path
            • LocalPlaylist.matcher
            • LocalPlaylist.limiter
            • LocalPlaylist.sorter
            • LocalPlaylist.path_mapper
            • LocalPlaylist.valid_extensions
            • LocalPlaylist.load()
            • LocalPlaylist.save()
        • M3U
          • SyncResultM3U
            • SyncResultM3U.start
            • SyncResultM3U.added
            • SyncResultM3U.removed
            • SyncResultM3U.unchanged
            • SyncResultM3U.difference
            • SyncResultM3U.final
          • M3U
            • M3U.valid_extensions
            • M3U.description
            • M3U.image_links
            • M3U.load()
            • M3U.save()
        • Utils
          • load_playlist()
        • XAUTOPF
          • SyncResultXAutoPF
            • SyncResultXAutoPF.start
            • SyncResultXAutoPF.start_included
            • SyncResultXAutoPF.start_excluded
            • SyncResultXAutoPF.start_compared
            • SyncResultXAutoPF.start_limiter
            • SyncResultXAutoPF.start_sorter
            • SyncResultXAutoPF.final
            • SyncResultXAutoPF.final_included
            • SyncResultXAutoPF.final_excluded
            • SyncResultXAutoPF.final_compared
            • SyncResultXAutoPF.final_limiter
            • SyncResultXAutoPF.final_sorter
          • XAutoPF
            • XAutoPF.valid_extensions
            • XAutoPF.default_xml
            • XAutoPF.description
            • XAutoPF.limiter_deduplication
            • XAutoPF.image_links
            • XAutoPF.load()
            • XAutoPF.save()
          • XMLPlaylistParser
            • XMLPlaylistParser.name_field_map
            • XMLPlaylistParser.field_name_map
            • XMLPlaylistParser.defined_sort
            • XMLPlaylistParser.default_sort
            • XMLPlaylistParser.default_group_by
            • XMLPlaylistParser.path
            • XMLPlaylistParser.xml_smart_playlist
            • XMLPlaylistParser.xml_source
            • XMLPlaylistParser.description
            • XMLPlaylistParser.path_mapper
            • XMLPlaylistParser.xml
            • XMLPlaylistParser.load()
            • XMLPlaylistParser.save()
            • XMLPlaylistParser.get_matcher()
            • XMLPlaylistParser.parse_matcher()
            • XMLPlaylistParser.parse_exception_paths()
            • XMLPlaylistParser.get_limiter()
            • XMLPlaylistParser.limiter_deduplication
            • XMLPlaylistParser.parse_limiter()
            • XMLPlaylistParser.get_sorter()
            • XMLPlaylistParser.valid_extensions
            • XMLPlaylistParser.parse_sorter()
            • XMLPlaylistParser.as_dict()
      • Track
        • Field
          • LocalTrackField
            • LocalTrackField.ALL
            • LocalTrackField.TITLE
            • LocalTrackField.ARTIST
            • LocalTrackField.ARTISTS
            • LocalTrackField.ALBUM
            • LocalTrackField.ALBUM_ARTIST
            • LocalTrackField.TRACK
            • LocalTrackField.TRACK_NUMBER
            • LocalTrackField.TRACK_TOTAL
            • LocalTrackField.GENRES
            • LocalTrackField.DATE
            • LocalTrackField.YEAR
            • LocalTrackField.MONTH
            • LocalTrackField.DAY
            • LocalTrackField.BPM
            • LocalTrackField.KEY
            • LocalTrackField.DISC
            • LocalTrackField.DISC_NUMBER
            • LocalTrackField.DISC_TOTAL
            • LocalTrackField.COMPILATION
            • LocalTrackField.COMMENTS
            • LocalTrackField.IMAGES
            • LocalTrackField.LENGTH
            • LocalTrackField.RATING
            • LocalTrackField.PATH
            • LocalTrackField.FOLDER
            • LocalTrackField.FILENAME
            • LocalTrackField.EXT
            • LocalTrackField.SIZE
            • LocalTrackField.TYPE
            • LocalTrackField.CHANNELS
            • LocalTrackField.BIT_RATE
            • LocalTrackField.BIT_DEPTH
            • LocalTrackField.SAMPLE_RATE
            • LocalTrackField.DATE_MODIFIED
            • LocalTrackField.DATE_ADDED
            • LocalTrackField.LAST_PLAYED
            • LocalTrackField.PLAY_COUNT
            • LocalTrackField.URI
        • FLAC
          • FLAC
            • FLAC.valid_extensions
            • FLAC.tag_map
        • M4A
          • M4A
            • M4A.valid_extensions
            • M4A.tag_map
        • MP3
          • MP3
            • MP3.valid_extensions
            • MP3.tag_map
        • Track
          • LocalTrack
            • LocalTrack.name
            • LocalTrack.tag_map
            • LocalTrack.title
            • LocalTrack.artist
            • LocalTrack.artists
            • LocalTrack.album
            • LocalTrack.album_artist
            • LocalTrack.track_number
            • LocalTrack.track_total
            • LocalTrack.genres
            • LocalTrack.date
            • LocalTrack.year
            • LocalTrack.month
            • LocalTrack.day
            • LocalTrack.bpm
            • LocalTrack.key
            • LocalTrack.disc_number
            • LocalTrack.disc_total
            • LocalTrack.compilation
            • LocalTrack.comments
            • LocalTrack.has_uri
            • LocalTrack.image_links
            • LocalTrack.has_image
            • LocalTrack.length
            • LocalTrack.rating
            • LocalTrack.path
            • LocalTrack.filename
            • LocalTrack.type
            • LocalTrack.channels
            • LocalTrack.bit_rate
            • LocalTrack.bit_depth
            • LocalTrack.sample_rate
            • LocalTrack.date_added
            • LocalTrack.last_played
            • LocalTrack.play_count
            • LocalTrack.load()
            • LocalTrack.refresh()
            • LocalTrack.save()
            • LocalTrack.move()
            • LocalTrack.rename()
            • LocalTrack.delete_tags()
            • LocalTrack.merge()
            • LocalTrack.extract_images_to_file()
            • LocalTrack.as_dict()
        • Utils
          • load_track()
        • WMA
          • WMA
            • WMA.valid_extensions
            • WMA.tag_map
      • Base
        • LocalItem
      • Collection
        • LocalCollection
          • LocalCollection.items
          • LocalCollection.tracks
          • LocalCollection.track_total
          • LocalCollection.last_modified
          • LocalCollection.last_added
          • LocalCollection.last_played
          • LocalCollection.play_count
          • LocalCollection.logger
          • LocalCollection.remote_wrangler
          • LocalCollection.save_tracks()
          • LocalCollection.log_save_tracks_result()
          • LocalCollection.merge_tracks()
        • BasicLocalCollection
          • BasicLocalCollection.name
          • BasicLocalCollection.tracks
          • BasicLocalCollection.length
        • LocalCollectionFiltered
          • LocalCollectionFiltered.name
          • LocalCollectionFiltered.tracks
          • LocalCollectionFiltered.artists
        • LocalFolder
          • LocalFolder.albums
          • LocalFolder.genres
          • LocalFolder.compilation
          • LocalFolder.load_folder()
        • LocalAlbum
          • LocalAlbum.album_artist
          • LocalAlbum.genres
          • LocalAlbum.date
          • LocalAlbum.year
          • LocalAlbum.month
          • LocalAlbum.day
          • LocalAlbum.compilation
          • LocalAlbum.image_links
          • LocalAlbum.has_image
          • LocalAlbum.rating
        • LocalArtist
          • LocalArtist.albums
          • LocalArtist.genres
          • LocalArtist.rating
        • LocalGenres
          • LocalGenres.albums
          • LocalGenres.related_genres
      • Exceptions
        • LocalError
        • LocalItemError
        • LocalCollectionError
        • TagError
        • LocalLibraryError
        • MusicBeeError
        • MusicBeeIDError
        • XMLReaderError
    • Remote
      • Core
        • API
          • RemoteAPI
            • RemoteAPI.collection_item_map
            • RemoteAPI.user_item_types
            • RemoteAPI.id_key
            • RemoteAPI.url_key
            • RemoteAPI.user_id
            • RemoteAPI.user_name
            • RemoteAPI.url
            • RemoteAPI.source
            • RemoteAPI.logger
            • RemoteAPI.wrangler
            • RemoteAPI.handler
            • RemoteAPI.user_data
            • RemoteAPI.user_playlist_data
            • RemoteAPI.authorise()
            • RemoteAPI.close()
            • RemoteAPI.load_user()
            • RemoteAPI.load_user_playlists()
            • RemoteAPI.print_item()
            • RemoteAPI.print_collection()
            • RemoteAPI.get_playlist_url()
            • RemoteAPI.get_self()
            • RemoteAPI.query()
            • RemoteAPI.extend_items()
            • RemoteAPI.get_items()
            • RemoteAPI.get_tracks()
            • RemoteAPI.get_user_items()
            • RemoteAPI.create_playlist()
            • RemoteAPI.add_to_playlist()
            • RemoteAPI.get_or_create_playlist()
            • RemoteAPI.follow_playlist()
            • RemoteAPI.delete_playlist()
            • RemoteAPI.clear_from_playlist()
        • Base
          • RemoteObject
            • RemoteObject.uri
            • RemoteObject.has_uri
            • RemoteObject.response
            • RemoteObject.kind
            • RemoteObject.api
            • RemoteObject.load()
            • RemoteObject.reload()
          • RemoteItem
            • RemoteItem.api
        • Exceptions
          • RemoteError
          • APIError
          • RemoteIDTypeError
          • RemoteObjectTypeError
        • Factory
          • RemoteObjectFactory
            • RemoteObjectFactory.playlist
            • RemoteObjectFactory.track
            • RemoteObjectFactory.album
            • RemoteObjectFactory.artist
            • RemoteObjectFactory.api
        • Library
          • RemoteLibrary
            • RemoteLibrary.factory
            • RemoteLibrary.api
            • RemoteLibrary.name
            • RemoteLibrary.id
            • RemoteLibrary.playlists
            • RemoteLibrary.tracks
            • RemoteLibrary.artists
            • RemoteLibrary.albums
            • RemoteLibrary.logger
            • RemoteLibrary.playlist_filter
            • RemoteLibrary.extend()
            • RemoteLibrary.load()
            • RemoteLibrary.load_playlists()
            • RemoteLibrary.log_playlists()
            • RemoteLibrary.load_tracks()
            • RemoteLibrary.enrich_tracks()
            • RemoteLibrary.log_tracks()
            • RemoteLibrary.load_saved_albums()
            • RemoteLibrary.enrich_saved_albums()
            • RemoteLibrary.log_albums()
            • RemoteLibrary.load_saved_artists()
            • RemoteLibrary.enrich_saved_artists()
            • RemoteLibrary.log_artists()
            • RemoteLibrary.backup_playlists()
            • RemoteLibrary.restore_playlists()
            • RemoteLibrary.sync()
            • RemoteLibrary.log_sync()
        • Object
          • RemoteTrack
          • RemoteCollection
          • RemoteCollectionLoader
            • RemoteCollectionLoader.load()
          • SyncResultRemotePlaylist
            • SyncResultRemotePlaylist.start
            • SyncResultRemotePlaylist.added
            • SyncResultRemotePlaylist.removed
            • SyncResultRemotePlaylist.unchanged
            • SyncResultRemotePlaylist.difference
            • SyncResultRemotePlaylist.final
          • RemotePlaylist
            • RemotePlaylist.owner_id
            • RemotePlaylist.owner_name
            • RemotePlaylist.followers
            • RemotePlaylist.date_added
            • RemotePlaylist.writeable
            • RemotePlaylist.create()
            • RemotePlaylist.delete()
            • RemotePlaylist.sync()
          • RemoteAlbum
            • RemoteAlbum.artists
          • RemoteArtist
            • RemoteArtist.tracks
            • RemoteArtist.artists
            • RemoteArtist.albums
            • RemoteArtist.track_total
            • RemoteArtist.image_links
            • RemoteArtist.has_image
            • RemoteArtist.length
        • Types
          • RemoteIDType
            • RemoteIDType.ALL
            • RemoteIDType.ID
            • RemoteIDType.URI
            • RemoteIDType.URL
            • RemoteIDType.URL_EXT
          • RemoteObjectType
            • RemoteObjectType.ALL
            • RemoteObjectType.PLAYLIST
            • RemoteObjectType.TRACK
            • RemoteObjectType.ALBUM
            • RemoteObjectType.ARTIST
            • RemoteObjectType.USER
            • RemoteObjectType.SHOW
            • RemoteObjectType.EPISODE
            • RemoteObjectType.AUDIOBOOK
            • RemoteObjectType.CHAPTER
        • Wrangle
          • RemoteDataWrangler
            • RemoteDataWrangler.source
            • RemoteDataWrangler.unavailable_uri_dummy
            • RemoteDataWrangler.url_api
            • RemoteDataWrangler.url_ext
            • RemoteDataWrangler.get_id_type()
            • RemoteDataWrangler.validate_id_type()
            • RemoteDataWrangler.get_item_type()
            • RemoteDataWrangler.validate_item_type()
            • RemoteDataWrangler.convert()
            • RemoteDataWrangler.extract_ids()
      • Spotify
        • API
          • API
            • SpotifyAPI
              • SpotifyAPI.user_id
              • SpotifyAPI.user_name
          • Base
            • SpotifyAPIBase
              • SpotifyAPIBase.items_key
              • SpotifyAPIBase.format_next_url()
          • Cache
            • SpotifyRepositorySettings
              • SpotifyRepositorySettings.fields
              • SpotifyRepositorySettings.get_key()
              • SpotifyRepositorySettings.get_name()
            • SpotifyPaginatedRepositorySettings
              • SpotifyPaginatedRepositorySettings.fields
              • SpotifyPaginatedRepositorySettings.get_key()
              • SpotifyPaginatedRepositorySettings.get_offset()
              • SpotifyPaginatedRepositorySettings.get_limit()
          • Item
            • SpotifyAPIItems
              • SpotifyAPIItems.extend_items()
              • SpotifyAPIItems.get_items()
              • SpotifyAPIItems.get_user_items()
              • SpotifyAPIItems.get_tracks()
              • SpotifyAPIItems.extend_tracks()
              • SpotifyAPIItems.get_artist_albums()
          • Misc
            • SpotifyAPIMisc
              • SpotifyAPIMisc.print_collection()
              • SpotifyAPIMisc.get_self()
              • SpotifyAPIMisc.query()
          • Playlist
            • SpotifyAPIPlaylists
              • SpotifyAPIPlaylists.load_user_playlists()
              • SpotifyAPIPlaylists.get_playlist_url()
              • SpotifyAPIPlaylists.create_playlist()
              • SpotifyAPIPlaylists.add_to_playlist()
              • SpotifyAPIPlaylists.follow_playlist()
              • SpotifyAPIPlaylists.delete_playlist()
              • SpotifyAPIPlaylists.clear_from_playlist()
        • Base
          • SpotifyObject
            • SpotifyObject.id
            • SpotifyObject.uri
            • SpotifyObject.has_uri
            • SpotifyObject.url
            • SpotifyObject.url_ext
          • SpotifyItem
        • Exceptions
          • SpotifyError
          • SpotifyItemError
          • SpotifyCollectionError
        • Factory
          • SpotifyObjectFactory
            • SpotifyObjectFactory.playlist
            • SpotifyObjectFactory.track
            • SpotifyObjectFactory.album
            • SpotifyObjectFactory.artist
        • Library
          • SpotifyLibrary
            • SpotifyLibrary.enrich_tracks()
            • SpotifyLibrary.enrich_saved_albums()
            • SpotifyLibrary.enrich_saved_artists()
        • Object
          • SpotifyTrack
            • SpotifyTrack.name
            • SpotifyTrack.title
            • SpotifyTrack.artist
            • SpotifyTrack.artists
            • SpotifyTrack.album
            • SpotifyTrack.album_artist
            • SpotifyTrack.track_number
            • SpotifyTrack.track_total
            • SpotifyTrack.genres
            • SpotifyTrack.year
            • SpotifyTrack.month
            • SpotifyTrack.day
            • SpotifyTrack.bpm
            • SpotifyTrack.key
            • SpotifyTrack.disc_number
            • SpotifyTrack.disc_total
            • SpotifyTrack.compilation
            • SpotifyTrack.comments
            • SpotifyTrack.image_links
            • SpotifyTrack.length
            • SpotifyTrack.rating
            • SpotifyTrack.refresh()
            • SpotifyTrack.load()
            • SpotifyTrack.reload()
          • SpotifyCollectionLoader
            • SpotifyCollectionLoader.load()
          • SpotifyPlaylist
            • SpotifyPlaylist.name
            • SpotifyPlaylist.description
            • SpotifyPlaylist.public
            • SpotifyPlaylist.collaborative
            • SpotifyPlaylist.followers
            • SpotifyPlaylist.owner_name
            • SpotifyPlaylist.owner_id
            • SpotifyPlaylist.tracks
            • SpotifyPlaylist.track_total
            • SpotifyPlaylist.image_links
            • SpotifyPlaylist.date_created
            • SpotifyPlaylist.date_modified
            • SpotifyPlaylist.date_added
            • SpotifyPlaylist.refresh()
            • SpotifyPlaylist.reload()
          • SpotifyAlbum
            • SpotifyAlbum.name
            • SpotifyAlbum.tracks
            • SpotifyAlbum.artists
            • SpotifyAlbum.artist
            • SpotifyAlbum.album_artist
            • SpotifyAlbum.track_total
            • SpotifyAlbum.genres
            • SpotifyAlbum.year
            • SpotifyAlbum.month
            • SpotifyAlbum.day
            • SpotifyAlbum.compilation
            • SpotifyAlbum.image_links
            • SpotifyAlbum.rating
            • SpotifyAlbum.refresh()
            • SpotifyAlbum.reload()
          • SpotifyArtist
            • SpotifyArtist.name
            • SpotifyArtist.items
            • SpotifyArtist.artist
            • SpotifyArtist.albums
            • SpotifyArtist.genres
            • SpotifyArtist.image_links
            • SpotifyArtist.rating
            • SpotifyArtist.followers
            • SpotifyArtist.refresh()
            • SpotifyArtist.reload()
        • Wrangle
          • SpotifyDataWrangler
            • SpotifyDataWrangler.source
            • SpotifyDataWrangler.unavailable_uri_dummy
            • SpotifyDataWrangler.url_api
            • SpotifyDataWrangler.url_ext
            • SpotifyDataWrangler.get_id_type()
            • SpotifyDataWrangler.validate_id_type()
            • SpotifyDataWrangler.convert()
            • SpotifyDataWrangler.extract_ids()
    • Collection
      • BasicCollection
        • BasicCollection.name
        • BasicCollection.items
        • BasicCollection.length
  • Processors
    • Base
      • Processor
      • InputProcessor
        • InputProcessor.logger
      • dynamicprocessormethod
      • DynamicProcessor
        • DynamicProcessor.processor_methods
      • Filter
        • Filter.ready
        • Filter.process()
        • Filter.transform
      • FilterComposite
        • FilterComposite.ready
        • FilterComposite.transform
        • FilterComposite.filters
    • Check
      • ItemCheckResult
        • ItemCheckResult.switched
        • ItemCheckResult.unavailable
        • ItemCheckResult.skipped
      • RemoteItemChecker
        • RemoteItemChecker.api
        • RemoteItemChecker.logger
        • RemoteItemChecker.matcher
        • RemoteItemChecker.factory
        • RemoteItemChecker.interval
        • RemoteItemChecker.allow_karaoke
        • RemoteItemChecker.check()
        • RemoteItemChecker.close()
        • RemoteItemChecker.as_dict()
    • Compare
      • Comparer
        • Comparer.condition
        • Comparer.expected
        • Comparer.field
        • Comparer.reference_required
        • Comparer.compare()
        • Comparer.as_dict()
    • Download
      • ItemDownloadHelper
        • ItemDownloadHelper.urls
        • ItemDownloadHelper.fields
        • ItemDownloadHelper.interval
        • ItemDownloadHelper.open_sites()
        • ItemDownloadHelper.as_dict()
    • Exceptions
      • ProcessorError
      • ProcessorLookupError
      • ComparerError
      • LimiterProcessorError
      • MatcherProcessorError
      • SorterProcessorError
      • TimeMapperError
      • FilterError
    • Filter
      • FilterDefinedList
        • FilterDefinedList.ready
        • FilterDefinedList.values
        • FilterDefinedList.process()
        • FilterDefinedList.as_dict()
      • FilterComparers
        • FilterComparers.ready
        • FilterComparers.comparers
        • FilterComparers.match_all
        • FilterComparers.process()
        • FilterComparers.as_dict()
      • FilterIncludeExclude
        • FilterIncludeExclude.include
        • FilterIncludeExclude.exclude
        • FilterIncludeExclude.process()
        • FilterIncludeExclude.as_dict()
    • Filter Matcher
      • MatchResult
        • MatchResult.included
        • MatchResult.excluded
        • MatchResult.compared
        • MatchResult.grouped
        • MatchResult.combined
      • FilterMatcher
        • FilterMatcher.logger
        • FilterMatcher.include
        • FilterMatcher.exclude
        • FilterMatcher.comparers
        • FilterMatcher.group_by
        • FilterMatcher.process()
        • FilterMatcher.process_to_result()
        • FilterMatcher.as_dict()
    • Limit
      • LimitType
        • LimitType.ITEMS
        • LimitType.ALBUMS
        • LimitType.SECONDS
        • LimitType.MINUTES
        • LimitType.HOURS
        • LimitType.DAYS
        • LimitType.WEEKS
        • LimitType.BYTES
        • LimitType.KILOBYTES
        • LimitType.MEGABYTES
        • LimitType.GIGABYTES
        • LimitType.TERABYTES
      • ItemLimiter
        • ItemLimiter.limit_sort
        • ItemLimiter.limit_max
        • ItemLimiter.kind
        • ItemLimiter.allowance
        • ItemLimiter.limit()
        • ItemLimiter.as_dict()
    • Match
      • CleanTagConfig
        • CleanTagConfig.tag
        • CleanTagConfig.remove
        • CleanTagConfig.split
        • CleanTagConfig.preprocess()
        • CleanTagConfig.as_dict()
      • ItemMatcher
        • ItemMatcher.karaoke_tags
        • ItemMatcher.year_range
        • ItemMatcher.clean_tags_remove_all
        • ItemMatcher.clean_tags_split_all
        • ItemMatcher.clean_tags_config
        • ItemMatcher.reduce_name_score_on
        • ItemMatcher.reduce_name_score_factor
        • ItemMatcher.logger
        • ItemMatcher.log()
        • ItemMatcher.clean_tags()
        • ItemMatcher.match_not_karaoke()
        • ItemMatcher.match_name()
        • ItemMatcher.match_artist()
        • ItemMatcher.match_album()
        • ItemMatcher.match_length()
        • ItemMatcher.match_year()
        • ItemMatcher.match()
        • ItemMatcher.as_dict()
    • Search
      • ItemSearchResult
        • ItemSearchResult.matched
        • ItemSearchResult.unmatched
        • ItemSearchResult.skipped
      • SearchConfig
        • SearchConfig.match_fields
        • SearchConfig.search_fields_1
        • SearchConfig.search_fields_2
        • SearchConfig.search_fields_3
        • SearchConfig.result_count
        • SearchConfig.min_score
        • SearchConfig.max_score
        • SearchConfig.allow_karaoke
      • RemoteItemSearcher
        • RemoteItemSearcher.search_settings
        • RemoteItemSearcher.api
        • RemoteItemSearcher.logger
        • RemoteItemSearcher.matcher
        • RemoteItemSearcher.factory
        • RemoteItemSearcher.search()
        • RemoteItemSearcher.as_dict()
    • Sort
      • ShuffleMode
        • ShuffleMode.RANDOM
        • ShuffleMode.HIGHER_RATING
        • ShuffleMode.RECENT_ADDED
        • ShuffleMode.DIFFERENT_ARTIST
      • ItemSorter
        • ItemSorter.sort_by_field()
        • ItemSorter.group_by_field()
        • ItemSorter.sort_fields
        • ItemSorter.shuffle_mode
        • ItemSorter.shuffle_weight
        • ItemSorter.ignore_words
        • ItemSorter.sort()
        • ItemSorter.as_dict()
    • Time
      • TimeMapper
        • TimeMapper.map()
        • TimeMapper.seconds()
        • TimeMapper.minutes()
        • TimeMapper.hours()
        • TimeMapper.days()
        • TimeMapper.weeks()
        • TimeMapper.months()
        • TimeMapper.as_dict()
  • Base
    • Result
    • MusifyObject
      • MusifyObject.tag_sep
      • MusifyObject.name
      • MusifyObject.clean_tags
    • MusifyItem
      • MusifyItem.uri
      • MusifyItem.has_uri
    • MusifyItemSettable
      • MusifyItemSettable.uri
    • HasLength
      • HasLength.length
  • Exceptions
    • MusifyError
    • MusifyKeyError
    • MusifyValueError
    • MusifyTypeError
    • MusifyAttributeError
    • MusifyImportError
    • MusifyEnumError
    • FieldError
  • Field
    • Field
      • Field.from_name()
      • Field.from_value()
    • Fields
      • Fields.ALL
      • Fields.NAME
      • Fields.TITLE
      • Fields.ARTIST
      • Fields.ARTISTS
      • Fields.ALBUM
      • Fields.ALBUM_ARTIST
      • Fields.TRACK_NUMBER
      • Fields.TRACK_TOTAL
      • Fields.GENRES
      • Fields.DATE
      • Fields.YEAR
      • Fields.MONTH
      • Fields.DAY
      • Fields.BPM
      • Fields.KEY
      • Fields.DISC_NUMBER
      • Fields.DISC_TOTAL
      • Fields.COMPILATION
      • Fields.COMMENTS
      • Fields.IMAGES
      • Fields.LENGTH
      • Fields.RATING
      • Fields.COMPOSER
      • Fields.CONDUCTOR
      • Fields.PUBLISHER
      • Fields.PATH
      • Fields.FOLDER
      • Fields.FILENAME
      • Fields.EXT
      • Fields.SIZE
      • Fields.TYPE
      • Fields.CHANNELS
      • Fields.BIT_RATE
      • Fields.BIT_DEPTH
      • Fields.SAMPLE_RATE
      • Fields.DATE_CREATED
      • Fields.DATE_MODIFIED
      • Fields.DATE_ADDED
      • Fields.LAST_PLAYED
      • Fields.PLAY_COUNT
      • Fields.DESCRIPTION
      • Fields.URI
      • Fields.USER_ID
      • Fields.USER_NAME
      • Fields.OWNER_ID
      • Fields.OWNER_NAME
      • Fields.FOLLOWERS
    • TagMap
      • TagMap.title
      • TagMap.artist
      • TagMap.album
      • TagMap.album_artist
      • TagMap.track_number
      • TagMap.track_total
      • TagMap.genres
      • TagMap.date
      • TagMap.year
      • TagMap.month
      • TagMap.day
      • TagMap.bpm
      • TagMap.key
      • TagMap.disc_number
      • TagMap.disc_total
      • TagMap.compilation
      • TagMap.comments
      • TagMap.images
    • TagField
      • TagField.all()
      • TagField.to_tag()
      • TagField.to_tags()
    • TagFields
      • TagFields.ALL
      • TagFields.NAME
      • TagFields.TITLE
      • TagFields.ARTIST
      • TagFields.ALBUM
      • TagFields.ALBUM_ARTIST
      • TagFields.TRACK_NUMBER
      • TagFields.TRACK_TOTAL
      • TagFields.GENRES
      • TagFields.DATE
      • TagFields.YEAR
      • TagFields.MONTH
      • TagFields.DAY
      • TagFields.BPM
      • TagFields.KEY
      • TagFields.DISC_NUMBER
      • TagFields.DISC_TOTAL
      • TagFields.COMPILATION
      • TagFields.COMMENTS
      • TagFields.IMAGES
      • TagFields.LENGTH
      • TagFields.RATING
      • TagFields.COMPOSER
      • TagFields.CONDUCTOR
      • TagFields.PUBLISHER
      • TagFields.PATH
      • TagFields.FOLDER
      • TagFields.FILENAME
      • TagFields.EXT
      • TagFields.SIZE
      • TagFields.TYPE
      • TagFields.CHANNELS
      • TagFields.BIT_RATE
      • TagFields.BIT_DEPTH
      • TagFields.SAMPLE_RATE
      • TagFields.DATE_CREATED
      • TagFields.DATE_MODIFIED
      • TagFields.DATE_ADDED
      • TagFields.LAST_PLAYED
      • TagFields.PLAY_COUNT
      • TagFields.DESCRIPTION
      • TagFields.URI
      • TagFields.USER_ID
      • TagFields.USER_NAME
      • TagFields.OWNER_ID
      • TagFields.OWNER_NAME
      • TagFields.FOLLOWERS
    • TrackFieldMixin
      • TrackFieldMixin.map()
    • TrackField
      • TrackField.ALL
      • TrackField.TITLE
      • TrackField.ARTIST
      • TrackField.ALBUM
      • TrackField.ALBUM_ARTIST
      • TrackField.TRACK
      • TrackField.TRACK_NUMBER
      • TrackField.TRACK_TOTAL
      • TrackField.GENRES
      • TrackField.DATE
      • TrackField.YEAR
      • TrackField.MONTH
      • TrackField.DAY
      • TrackField.BPM
      • TrackField.KEY
      • TrackField.DISC
      • TrackField.DISC_NUMBER
      • TrackField.DISC_TOTAL
      • TrackField.COMPILATION
      • TrackField.COMMENTS
      • TrackField.IMAGES
      • TrackField.LENGTH
      • TrackField.RATING
      • TrackField.URI
    • PlaylistField
      • PlaylistField.ALL
      • PlaylistField.TRACK_TOTAL
      • PlaylistField.IMAGES
      • PlaylistField.LENGTH
      • PlaylistField.DATE_CREATED
      • PlaylistField.DATE_MODIFIED
      • PlaylistField.DESCRIPTION
    • FolderField
      • FolderField.ALL
      • FolderField.TRACK_TOTAL
      • FolderField.GENRES
      • FolderField.IMAGES
      • FolderField.COMPILATION
      • FolderField.LENGTH
      • FolderField.FOLDER
    • AlbumField
      • AlbumField.ALL
      • AlbumField.ARTIST
      • AlbumField.ALBUM
      • AlbumField.ALBUM_ARTIST
      • AlbumField.TRACK_TOTAL
      • AlbumField.GENRES
      • AlbumField.DATE
      • AlbumField.YEAR
      • AlbumField.MONTH
      • AlbumField.DAY
      • AlbumField.DISC_TOTAL
      • AlbumField.COMPILATION
      • AlbumField.IMAGES
      • AlbumField.LENGTH
      • AlbumField.RATING
    • ArtistField
      • ArtistField.ALL
      • ArtistField.ARTIST
      • ArtistField.TRACK_TOTAL
      • ArtistField.GENRES
      • ArtistField.IMAGES
      • ArtistField.LENGTH
      • ArtistField.RATING
  • Logger
    • MusifyLogger
      • MusifyLogger.compact
      • MusifyLogger.disable_bars
      • MusifyLogger.file_paths
      • MusifyLogger.stdout_handlers
      • MusifyLogger.info_extra()
      • MusifyLogger.report()
      • MusifyLogger.stat()
      • MusifyLogger.print_line()
      • MusifyLogger.print_message()
      • MusifyLogger.get_synchronous_iterator()
      • MusifyLogger.get_asynchronous_iterator()
  • Printer
    • PrettyPrinter
      • PrettyPrinter.as_dict()
      • PrettyPrinter.json()
    • AttributePrinter
      • AttributePrinter.as_dict()
  • Report
    • report_playlist_differences()
    • report_missing_tags()
  • Types
    • MusifyEnum
      • MusifyEnum.map()
      • MusifyEnum.all()
      • MusifyEnum.from_name()
      • MusifyEnum.from_value()
  • Utils
    • classproperty
    • SafeDict
    • strip_ignore_words()
    • safe_format_map()
    • unicode_len()
    • unicode_reversed()
    • get_max_width()
    • align_string()
    • limit_value()
    • to_collection()
    • flatten_nested()
    • merge_maps()
    • get_most_common_values()
    • get_user_input()
    • required_modules_installed()
  • Index
Musify
  • Processors
  • Search
  • Edit on GitHub

Search

Inheritance diagram of musify.processors.search

Processor operations that search for and match given items with remote items.

Searches for matches on remote APIs, matches the item to the best matching result from the query, and assigns the ID of the matched object back to the item.

Classes:

ItemSearchResult([matched, unmatched, skipped])

Stores the results of the searching process.

SearchConfig(match_fields[, ...])

Key settings related to a search algorithm.

RemoteItemSearcher(matcher, object_factory)

Searches for remote matches for a list of item collections.

class musify.processors.search.ItemSearchResult(matched=(), unmatched=(), skipped=())

Bases: Result, Generic

Stores the results of the searching process.

Attributes:

matched

Sequence of Items for which matches were found from the search.

unmatched

Sequence of Items for which matches were not found from the search.

skipped

Sequence of Items which were skipped during the search.

matched: Sequence[TypeVar(T, bound= MusifyItemSettable)] = ()

Sequence of Items for which matches were found from the search.

unmatched: Sequence[TypeVar(T, bound= MusifyItemSettable)] = ()

Sequence of Items for which matches were not found from the search.

skipped: Sequence[TypeVar(T, bound= MusifyItemSettable)] = ()

Sequence of Items which were skipped during the search.

class musify.processors.search.SearchConfig(match_fields, search_fields_1=(TagFields.NAME,), search_fields_2=(), search_fields_3=(), result_count=10, min_score=0.1, max_score=0.8, allow_karaoke=False)

Bases: object

Key settings related to a search algorithm.

Attributes:

match_fields

The fields to match results on.

search_fields_1

A sequence of the tag names to use as search fields in the 1st pass.

search_fields_2

If no results are found from the tag names in search_fields_1 on the 1st pass, an optional sequence of the tag names to use as search fields in the 2nd pass.

search_fields_3

If no results are found from the tag names in search_fields_2 on the 2nd pass, an optional sequence of the tag names to use as search fields in the 3rd pass.

result_count

The number of the results to request when querying the API.

min_score

The minimum acceptable score for an item to be considered a match.

max_score

The maximum score for an item to be considered a perfect match.

allow_karaoke

When True, items determined to be karaoke are allowed when matching added items.

match_fields: TagField | Iterable[TagField]

The fields to match results on.

search_fields_1: Sequence[TagField] = (TagFields.NAME,)

A sequence of the tag names to use as search fields in the 1st pass.

search_fields_2: Iterable[TagField] = ()

If no results are found from the tag names in search_fields_1 on the 1st pass, an optional sequence of the tag names to use as search fields in the 2nd pass.

search_fields_3: Iterable[TagField] = ()

If no results are found from the tag names in search_fields_2 on the 2nd pass, an optional sequence of the tag names to use as search fields in the 3rd pass.

result_count: int = 10

The number of the results to request when querying the API.

min_score: float = 0.1

The minimum acceptable score for an item to be considered a match.

max_score: float = 0.8

The maximum score for an item to be considered a perfect match. After this score is reached by an item, any other items are disregarded as potential matches.

allow_karaoke: bool = False

When True, items determined to be karaoke are allowed when matching added items. Skip karaoke results otherwise.

class musify.processors.search.RemoteItemSearcher(matcher, object_factory)

Bases: Processor

Searches for remote matches for a list of item collections.

Parameters:
  • matcher (ItemMatcher) – The ItemMatcher to use when comparing any changes made by the user in remote playlists during the checking operation

  • object_factory (RemoteObjectFactory) – The RemoteObjectFactory to use when creating new remote objects. This must have a RemoteAPI assigned for this processor to work as expected.

Attributes:

search_settings

The SearchSettings for each RemoteObjectType

api

The RemoteAPI to call

logger

The MusifyLogger for this object

matcher

The ItemMatcher to use when comparing any changes made by the user in remote playlists during the checking operation

factory

The RemoteObjectFactory to use when creating new remote objects.

Methods:

search(collections)

Searches for remote matches for the given list of item collections.

as_dict()

Return a dictionary representation of the key attributes of this object.

search_settings: dict[RemoteObjectType, SearchConfig] = {RemoteObjectType.TRACK: SearchConfig(match_fields={<TagFields.ARTIST: 32>, <TagFields.TITLE: 65>, <TagFields.ALBUM: 30>, <TagFields.LENGTH: 16>}, search_fields_1=[<TagFields.NAME: 1000>, <TagFields.ARTIST: 32>], search_fields_2=[<TagFields.NAME: 1000>, <TagFields.ALBUM: 30>], search_fields_3=[<TagFields.NAME: 1000>], result_count=10, min_score=0.1, max_score=0.8, allow_karaoke=False), RemoteObjectType.ALBUM: SearchConfig(match_fields={<TagFields.ARTIST: 32>, <TagFields.LENGTH: 16>, <TagFields.ALBUM: 30>}, search_fields_1=[<TagFields.NAME: 1000>, <TagFields.ARTIST: 32>], search_fields_2=[<TagFields.NAME: 1000>], search_fields_3=(), result_count=5, min_score=0.1, max_score=0.7, allow_karaoke=False)}

The SearchSettings for each RemoteObjectType

property api: RemoteAPI

The RemoteAPI to call

logger: MusifyLogger

The MusifyLogger for this object

matcher

The ItemMatcher to use when comparing any changes made by the user in remote playlists during the checking operation

factory

The RemoteObjectFactory to use when creating new remote objects.

async search(collections)

Searches for remote matches for the given list of item collections.

Returns:

dict[str, ItemSearchResult[TypeVar(T, bound= MusifyItemSettable)]] – Map of the collection’s name to its ItemSearchResult object.

as_dict()

Return a dictionary representation of the key attributes of this object.

Return type:

dict[str, Any]

The results of this function are used to produce the following:
  • A JSON representation of the object when calling json()

  • The string representation of the object when calling str() on the object

  • The representation of the object when calling repr() on the object

Previous Next

© Copyright 2025, George Martin Marino.

Built with Sphinx using a theme provided by Read the Docs.