Index
+ +A
+B
++ | + |
C
+D
+E
+F
+G
+H
+I
+J
++ |
K
+L
+M
+N
+O
++ | + |
P
+Q
++ | + |
R
+S
+T
+U
+V
++ | + |
W
++ | + |
X
+
|
+
Y
++ | + |
' + + '' + + _("Hide Search Matches") + + "
" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/_build/genindex.html b/_build/genindex.html new file mode 100644 index 00000000..b10d341e --- /dev/null +++ b/_build/genindex.html @@ -0,0 +1,3039 @@ + + + + + + ++ | + |
+ |
+ | + |
+ | + |
+ | + |
+ | + |
|
+
+ | + |
BaseConfig
+Config
+ConfigAPI
+ConfigFilter
+ConfigLibrary
+ConfigLibraryDifferences
ConfigLocal
+ConfigMissingTags
+ConfigMusicBee
+ConfigPlaylists
ConfigRemote
+ConfigReportBase
+ConfigReports
+ConfigSpotify
+RemoteClasses
+AlbumField
+ArtistField
+FolderField
+LocalTrackField
LocalTrackField.ALBUM
LocalTrackField.ALBUM_ARTIST
LocalTrackField.ALL
LocalTrackField.ARTIST
LocalTrackField.BIT_DEPTH
LocalTrackField.BIT_RATE
LocalTrackField.BPM
LocalTrackField.CHANNELS
LocalTrackField.COMMENTS
LocalTrackField.COMPILATION
LocalTrackField.DATE
LocalTrackField.DATE_ADDED
LocalTrackField.DATE_MODIFIED
LocalTrackField.DAY
LocalTrackField.DISC
LocalTrackField.DISC_NUMBER
LocalTrackField.DISC_TOTAL
LocalTrackField.EXT
LocalTrackField.FILENAME
LocalTrackField.FOLDER
LocalTrackField.GENRES
LocalTrackField.IMAGES
LocalTrackField.KEY
LocalTrackField.KIND
LocalTrackField.LAST_PLAYED
LocalTrackField.LENGTH
LocalTrackField.MONTH
LocalTrackField.PATH
LocalTrackField.PLAY_COUNT
LocalTrackField.RATING
LocalTrackField.SAMPLE_RATE
LocalTrackField.SIZE
LocalTrackField.TITLE
LocalTrackField.TRACK
LocalTrackField.TRACK_NUMBER
LocalTrackField.TRACK_TOTAL
LocalTrackField.URI
LocalTrackField.YEAR
PlaylistField
+TrackField
TrackField.ALBUM
TrackField.ALBUM_ARTIST
TrackField.ALL
TrackField.ARTIST
TrackField.BPM
TrackField.COMMENTS
TrackField.COMPILATION
TrackField.DISC
TrackField.DISC_NUMBER
TrackField.DISC_TOTAL
TrackField.GENRES
TrackField.IMAGES
TrackField.KEY
TrackField.LENGTH
TrackField.RATING
TrackField.TITLE
TrackField.TRACK
TrackField.TRACK_NUMBER
TrackField.TRACK_TOTAL
TrackField.URI
TrackField.YEAR
TrackFieldMixin
++ Searching for multiple words only shows matches that contain + all words. +
+ + + + + + +Bases: NamedObjectPrinter
, MutableSequence
, Generic
Generic class for storing a collection of items.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+Append one item to the items in this collection
+Remove all items from this collection
+Return a shallow copy of the list of items in this collection
+Return the number of occurrences of the given Item
in this collection
Append many items to the items in this collection
+Return first index of item from items in this collection.
+ValueError – If the value is not present.
SyncifyTypeError – If given item does not match the item type of this collection.
Insert given Item
before the given index
The items in this collection
+Remove one item from the items in this collection and return it
+Remove one item from the items in this collection
+Reverse the order of items in this collection in-place
+Sort items in this collection in-place based on given conditions. +If key is given,
+fields –
When None and ShuffleMode is RANDOM, shuffle the tracks. Otherwise, do nothing.
List of tags/properties to sort by.
Map of {tag/property
: reversed
}. If reversed is true, sort the tag/property
in reverse.
shuffle_mode – The mode to use for shuffling.
shuffle_by – The field to shuffle by when shuffling.
shuffle_weight – The weights (between 0 and 1) to apply to shuffling modes that can use it. +This value will automatically be limited to within the accepted range 0 and 1.
key – Tag or property to sort on. Can be given instead of fields
for a simple sort.
+If set, all other fields apart from reverse
are ignored.
+If None, fields
, shuffle_mode
, shuffle_by
, and shuffle_weight
are used to apply sorting.
reverse – If true, reverse the order of the sort at the end.
Bases: SyncifyEnum
Base class for field names of an item.
+Bases: Field
Contains all possible Field enums in this program.
+This is used to ensure all Field enum implementations have the same values for their enum names.
+Bases: IntEnum
Generic class for storing IntEnums.
+Get all enums for this enum.
+Returns all enums that match the given enum names
+fail_on_many – If more than one enum is found, raise an exception.
+EnumNotFoundError – If a corresponding enum cannot be found.
+Returns all enums that match the given enum values
+fail_on_many – If more than one enum is found, raise an exception.
+EnumNotFoundError – If a corresponding enum cannot be found.
+“Optional mapper to apply to the enum found during all()
, from_name()
,
+and from_value()
calls
Bases: Field
Applies extra functionality to the Field enum for Field types relating to Track
types
Get all enums for this enum.
+When only_tags
is True, returns only those enums that represent a tag for this TagField type.
Bases: TagField
Contains all possible TagField enums in this program.
+This is used to ensure all TagField enum implementations have the same values for their enum names.
+Bases: object
Map of human-friendly tag name to ID3 tag ids for a given file type
+Bases: ABC
, Collection
, Generic
Base class for filtering down values based on some settings
+Filter down given values
or stored available
values that match this filter’s settings
Does this filter have valid settings and can process values
+Bases: ABC
Generic base class for pretty printing. Classes can inherit this class to gain pretty print functionality.
+Return a dictionary representation of the key attributes of this object.
+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
Return a dictionary representation of the key attributes of this object that is safe to output to JSON
+Bases: object
Stores the results of an operation within Syncify
+Bases: ItemCollection
, Generic
An album of items and some of their derived properties/objects.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+The album name
+The album artist for this album
+Joined string representation of all artists on this album ordered by frequency of appearance
+List of artists ordered by frequency of appearance on the tracks on this album
+Is this album a compilation
+The day this album was released
+The highest value of disc number on this album
+List of genres ordered by frequency of appearance on the tracks on this album
+Does this album have an image
+The images associated with this album in the form {image name: image link}
The tracks in this collection
+Total duration of all tracks on this album in seconds
+The month this album was released
+The album name
+Rating of this album
+The total number of tracks on this album
+The tracks on this album
+The year this album was released
+Bases: ItemCollection
, Generic
An artist of items and some of their derived properties/objects
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+List of albums ordered by frequency of appearance on the tracks by this artist
+The artist name
+List of other artists ordered by frequency of appearance on the albums by this artist
+List of genres for this artist
+The tracks in this collection
+Total duration of all tracks by this artist
+The artist name
+The popularity of this artist
+The total number of tracks by this artist
+The tracks by this artist
+Bases: ItemCollection
, Generic
A basic implementation of ItemCollection for storing items
with a given name
.
tag_sep – When representing a list of tags as a string, use this value as the separator.
+name – The name of this collection.
items – The items in this collection
Return a dictionary representation of the key attributes of this object.
+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
The items in this collection
+The name of this collection
+Bases: ItemCollection
, Generic
A folder of items and some of their derived properties/objects
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+List of albums ordered by frequency of appearance on the tracks in this folder
+List of artists ordered by frequency of appearance on the tracks in this folder
+Is this folder a compilation
+The folder name
+List of genres ordered by frequency of appearance on the tracks in this folder
+The tracks in this collection
+Total duration of all tracks in this folder
+The folder name
+The total number of tracks in this folder
+The tracks in this folder
+Bases: ItemCollection
, Generic
A genre of items and some of their derived properties/objects
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+List of albums ordered by frequency of appearance on the tracks for this genre
+List of artists ordered by frequency of appearance on the tracks for this genre
+The genre
+List of genres ordered by frequency of appearance on the tracks for this genre
+The tracks in this collection
+The genre
+The tracks for this genre
+Bases: ItemCollection
, Generic
A library of items and playlists
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+Returns a filtered set of playlists in this library. +The playlists returned are deep copies of the playlists in the library.
+include – An optional list or Filter
of playlist names to include.
exclude – An optional list or Filter
of playlist names to exclude.
filter_tags – Provide optional kwargs of the tags and values of items to filter out of every playlist. +Parse a tag name as a parameter, any item matching the values given for this tag will be filtered out. +NOTE: Only string value types are currently supported.
Filtered playlists.
+The tracks in this collection
+Merge playlists from given list/map/library to this library
+The library name
+The total number of tracks in this library
+The tracks in this library
+Bases: ItemCollection
, Generic
A playlist of items and some of their derived properties/objects.
+datetime
object representing when the playlist was created
datetime
object representing when the playlist was last modified
Description of this playlist
+Does this playlist have an image
+The images associated with this playlist in the form {image name: image link}
The tracks in this collection
+Total duration of all tracks in this playlist in seconds
+Merge tracks in this playlist with another playlist synchronising tracks between the two. +Only modifies this playlist.
+The name of this playlist
+The total number of tracks in this playlist
+The tracks in this playlist
+Bases: Item
Metadata/tags associated with a track.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+The album this track is featured on
+The artist of the album this track is featured on
+Joined string representation of all artists featured on this track
+The tempo of this track
+Comments associated with this track set by the user
+Is the album this track is featured on a compilation
+The day this track was released
+The number of the disc from the album this track is featured on
+The total number the discs from the album this track is featured on
+List of genres associated with this track
+Does the album this track is associated with have an image
+The images associated with the album this track is featured on in the form {image name: image link}
The key of this track in alphabetical musical notation format
+Total duration of this track in seconds
+The month this track was released
+This track’s title
+The rating for this track
+This track’s title
+The position this track has on the album it is featured on
+The track number of tracks on the album this track is featured on
+The year this track was released
+Bases: SyncifyError
Exception raised for API errors.
+message – Explanation of the error.
response – The Response
related to the error.
ItemCollection
+Field
Fields
Fields.ALBUM
Fields.ALBUM_ARTIST
Fields.ALL
Fields.ARTIST
Fields.BIT_DEPTH
Fields.BIT_RATE
Fields.BPM
Fields.CHANNELS
Fields.COMMENTS
Fields.COMPILATION
Fields.COMPOSER
Fields.CONDUCTOR
Fields.DATE
Fields.DATE_ADDED
Fields.DATE_CREATED
Fields.DATE_MODIFIED
Fields.DAY
Fields.DESCRIPTION
Fields.DISC_NUMBER
Fields.DISC_TOTAL
Fields.EXT
Fields.FILENAME
Fields.FOLDER
Fields.FOLLOWERS
Fields.GENRES
Fields.IMAGES
Fields.KEY
Fields.KIND
Fields.LAST_PLAYED
Fields.LENGTH
Fields.MONTH
Fields.NAME
Fields.OWNER_ID
Fields.OWNER_NAME
Fields.PATH
Fields.PLAY_COUNT
Fields.PUBLISHER
Fields.RATING
Fields.SAMPLE_RATE
Fields.SIZE
Fields.TITLE
Fields.TRACK_NUMBER
Fields.TRACK_TOTAL
Fields.URI
Fields.USER_ID
Fields.USER_NAME
Fields.YEAR
SyncifyEnum
+TagField
+TagFields
TagFields.ALBUM
TagFields.ALBUM_ARTIST
TagFields.ALL
TagFields.ARTIST
TagFields.BIT_DEPTH
TagFields.BIT_RATE
TagFields.BPM
TagFields.CHANNELS
TagFields.COMMENTS
TagFields.COMPILATION
TagFields.COMPOSER
TagFields.CONDUCTOR
TagFields.DATE
TagFields.DATE_ADDED
TagFields.DATE_CREATED
TagFields.DATE_MODIFIED
TagFields.DAY
TagFields.DESCRIPTION
TagFields.DISC_NUMBER
TagFields.DISC_TOTAL
TagFields.EXT
TagFields.FILENAME
TagFields.FOLDER
TagFields.FOLLOWERS
TagFields.GENRES
TagFields.IMAGES
TagFields.KEY
TagFields.KIND
TagFields.LAST_PLAYED
TagFields.LENGTH
TagFields.MONTH
TagFields.NAME
TagFields.OWNER_ID
TagFields.OWNER_NAME
TagFields.PATH
TagFields.PLAY_COUNT
TagFields.PUBLISHER
TagFields.RATING
TagFields.SAMPLE_RATE
TagFields.SIZE
TagFields.TITLE
TagFields.TRACK_NUMBER
TagFields.TRACK_TOTAL
TagFields.URI
TagFields.USER_ID
TagFields.USER_NAME
TagFields.YEAR
TagMap
+Album
+Artist
+BasicCollection
+Folder
+Genre
+Library
+Playlist
+Track
Track.album
Track.album_artist
Track.artist
Track.artists
Track.bpm
Track.comments
Track.compilation
Track.date
Track.day
Track.disc_number
Track.disc_total
Track.genres
Track.has_image
Track.image_links
Track.key
Track.length
Track.month
Track.name
Track.rating
Track.title
Track.track_number
Track.track_total
Track.year
LocalAlbum
+LocalArtist
+LocalCollection
LocalCollection.artists
LocalCollection.as_dict()
LocalCollection.genres
LocalCollection.items
LocalCollection.last_added
LocalCollection.last_modified
LocalCollection.last_played
LocalCollection.length
LocalCollection.log_sync_result()
LocalCollection.logger
LocalCollection.merge_tracks()
LocalCollection.play_count
LocalCollection.remote_wrangler
LocalCollection.save_tracks()
LocalCollection.track_paths
LocalCollection.track_total
LocalCollection.tracks
LocalCollectionFiltered
+LocalFolder
+LocalGenres
+ItemLimiter
+LimitType
+CleanTagConfig
+ItemMatcher
ItemMatcher.as_dict()
ItemMatcher.clean_tags()
ItemMatcher.clean_tags_config
ItemMatcher.clean_tags_remove_all
ItemMatcher.clean_tags_split_all
ItemMatcher.karaoke_tags
ItemMatcher.logger
ItemMatcher.match()
ItemMatcher.match_album()
ItemMatcher.match_artist()
ItemMatcher.match_length()
ItemMatcher.match_name()
ItemMatcher.match_not_karaoke()
ItemMatcher.match_year()
ItemMatcher.reduce_name_score_factor
ItemMatcher.reduce_name_score_on
ItemMatcher.year_range
ItemSorter
+ShuffleBy
+ShuffleMode
+RemoteAPI
RemoteAPI.add_to_playlist()
RemoteAPI.api_url_base
RemoteAPI.authorise()
RemoteAPI.clear_from_playlist()
RemoteAPI.collection_item_map
RemoteAPI.create_playlist()
RemoteAPI.delete_playlist()
RemoteAPI.extend_items()
RemoteAPI.get_items()
RemoteAPI.get_playlist_url()
RemoteAPI.get_self()
RemoteAPI.get_tracks()
RemoteAPI.get_user_items()
RemoteAPI.handler
RemoteAPI.load_user_data()
RemoteAPI.logger
RemoteAPI.print_collection()
RemoteAPI.print_item()
RemoteAPI.query()
RemoteAPI.user_data
RemoteAPI.user_id
RemoteAPI.user_item_types
RemoteAPI.user_name
RemoteIDType
+RemoteObjectType
+RemoteLibrary
RemoteLibrary.albums
RemoteLibrary.api
RemoteLibrary.artists
RemoteLibrary.as_dict()
RemoteLibrary.backup_playlists()
RemoteLibrary.enrich_saved_albums()
RemoteLibrary.enrich_saved_artists()
RemoteLibrary.enrich_tracks()
RemoteLibrary.exclude
RemoteLibrary.extend()
RemoteLibrary.id
RemoteLibrary.include
RemoteLibrary.json()
RemoteLibrary.load()
RemoteLibrary.load_playlists()
RemoteLibrary.load_saved_albums()
RemoteLibrary.load_saved_artists()
RemoteLibrary.load_saved_tracks()
RemoteLibrary.log_albums()
RemoteLibrary.log_artists()
RemoteLibrary.log_playlists()
RemoteLibrary.log_sync()
RemoteLibrary.log_tracks()
RemoteLibrary.name
RemoteLibrary.playlists
RemoteLibrary.restore_playlists()
RemoteLibrary.sync()
RemoteLibrary.tracks
RemoteLibrary.use_cache
SpotifyLibrary
SpotifyLibrary.albums
SpotifyLibrary.api
SpotifyLibrary.artists
SpotifyLibrary.enrich_saved_albums()
SpotifyLibrary.enrich_saved_artists()
SpotifyLibrary.enrich_tracks()
SpotifyLibrary.exclude
SpotifyLibrary.include
SpotifyLibrary.merge_playlists()
SpotifyLibrary.playlists
SpotifyLibrary.use_cache
SpotifyAlbum
SpotifyAlbum.album_artist
SpotifyAlbum.artist
SpotifyAlbum.artists
SpotifyAlbum.compilation
SpotifyAlbum.day
SpotifyAlbum.genres
SpotifyAlbum.has_image
SpotifyAlbum.image_links
SpotifyAlbum.length
SpotifyAlbum.month
SpotifyAlbum.name
SpotifyAlbum.rating
SpotifyAlbum.refresh()
SpotifyAlbum.reload()
SpotifyAlbum.track_total
SpotifyAlbum.tracks
SpotifyAlbum.year
SpotifyArtist
+SpotifyCollection
SpotifyCollectionLoader
+SpotifyItemWranglerMixin
+SpotifyObjectLoaderMixin
+SpotifyPlaylist
SpotifyPlaylist.collaborative
SpotifyPlaylist.date_added
SpotifyPlaylist.date_created
SpotifyPlaylist.date_modified
SpotifyPlaylist.description
SpotifyPlaylist.followers
SpotifyPlaylist.has_image
SpotifyPlaylist.image_links
SpotifyPlaylist.name
SpotifyPlaylist.owner_id
SpotifyPlaylist.owner_name
SpotifyPlaylist.public
SpotifyPlaylist.refresh()
SpotifyPlaylist.reload()
SpotifyPlaylist.track_total
SpotifyPlaylist.tracks
SpotifyTrack
SpotifyTrack.album
SpotifyTrack.album_artist
SpotifyTrack.artist
SpotifyTrack.artists
SpotifyTrack.bpm
SpotifyTrack.comments
SpotifyTrack.compilation
SpotifyTrack.day
SpotifyTrack.disc_number
SpotifyTrack.disc_total
SpotifyTrack.genres
SpotifyTrack.has_image
SpotifyTrack.image_links
SpotifyTrack.key
SpotifyTrack.length
SpotifyTrack.load()
SpotifyTrack.month
SpotifyTrack.name
SpotifyTrack.rating
SpotifyTrack.refresh()
SpotifyTrack.reload()
SpotifyTrack.title
SpotifyTrack.track_number
SpotifyTrack.track_total
SpotifyTrack.year
Bases: PrettyPrinter
Base config section representing a config block from the file
+Merge the currently stored config values with the config from a given other
configured config object
+When override
is True, force overwrite any values in self
with other
.
Bases: BaseConfig
Set up config and provide framework for initialising various objects
+needed for the main functionality of the program from a given config file at path
.
The following options are in place for configuration values:
+DEFAULT: When a value is not found, a default value will be used.
REQUIRED: The configuration will fail if this value is not given. Only applies when the key is called.
None
will be set when this is the case.The configuration will not fail if this value is not given.
+Sub-configs have an override
parameter that can be set using the override
key in initial config block.
+When override is True and config
given, override loaded config from the file with values in config
+only using loaded values when values are not present in given config
.
+When override is False and config
given, loaded config takes priority
+and given config
values are only used when values are not present in the file.
+By default, always keep the current settings.
path – Path of the config file to use. If relative path given, appends package root path.
+Return a dictionary representation of the key attributes of this object.
+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
Load config from the config file at the given key
respecting override
rules.
key – The key to pull config from within the file. +Used as the parent key to use to pull the required configuration from the config file. +If not given, use the root values in the config file.
+Load logging config from the JSON or YAML file at the given path
using logging.config.dictConfig.
+If relative path given, appends package root path.
path – The path to the logger config
name – If the given name is a valid logger name in the config, +assign this logger’s config to the module root logger.
names – When given, also apply the config from name
to loggers with these names
.
DEFAULT = ‘<package_root>/_data’ | The output folder for saving diagnostic data
+OPTIONAL | A message to display when pausing
+DEFAULT = <map of all libraries to empty tuples> | +The keys of libraries as found in either ‘local’ or ‘remote’ maps to reload +mapped to the types of data to reload for each library.
+Bases: BaseConfig
Set the settings for the remote API from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Set up and return a valid API session for this remote source type.
+Return a dictionary representation of the key attributes of this object.
+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
DEFAULT = ‘.api_cache’ | The path of the cache to use when using cached requests for the API
+OPTIONAL | The client secret to use when authorising access to the API.
+DEFAULT = True | When True, use requests cache where possible when making API calls. +When False, always make calls to the API, refreshing any cached data in the process.
+Bases: BaseConfig
, Filter
[str
]
Set the settings for granular filtering from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: BaseConfig
, Filter
[str
]
Set the settings for filter options from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
key – The key to load filter options for. +Used as the parent key to use to pull the required configuration from the config file.
Return a dictionary representation of the key attributes of this object.
+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
DEFAULT = False | When True, a value has to match all conditions +to be considered a match by the filter when processing.
+Merge the currently stored config values with the config from a given other
configured config object
+When override
is True, force overwrite any values in self
with other
.
Returns all strings from values
that match this filter’s settings
Does this filter have valid settings and can process values
+DEFAULT = () | The filtered values.
+Filters available
values based on prefix
, start
, and stop
as applicable.
+available
values are taken from the config if the config is a list of strings.
Return a dictionary representation of the key attributes of this object.
+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
Filter down values
that match this filter’s settings from
Does this filter have valid settings and can process values
+Bases: BaseConfig
Set the settings for a library from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
key – The key to load filter options for. +Used as the parent key to use to pull the required configuration from the config file.
Return a dictionary representation of the key attributes of this object.
+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
The config identifier that gives the type of library being configured
+The name of the source currently being used for this library
+Bases: ConfigReportBase
Set the settings for the library differences report from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: ConfigLibrary
Set the settings for the local functionality of the program from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: BaseConfig
Set the settings for the playlists from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
DEFAULT = False | Destructively replace tags in each file.
+DEFAULT = (<all LocalTrackFields>) | The tags to be updated.
+Return a dictionary representation of the key attributes of this object.
+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
An initialised library
+REQUIRED | The path of the local library folder
+DEFAULT = () | The paths of other folder to use for replacement when processing local libraries
+DEFAULT = ‘Playlists’ | The path of the playlist folder.
+The remote wrangler to apply when initialising a library
+The name of the source currently being used for this library
+Bases: ConfigReportBase
Set the settings for the missing tags report from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
DEFAULT = True | When True, consider a track as having missing tags only if it is missing all the given tags.
+DEFAULT = (<all LocalTrackFields>) | The tags to be updated.
+Bases: ConfigLocal
Set the settings for the local functionality of the program for a MusicBee from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
An initialised library
+OPTIONAL | The path of the MusicBee library folder.
+The name of the source currently being used for this library
+Bases: ConfigFilter
Set the settings for the playlists from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: ConfigLibrary
Set the settings for the remote functionality of the program from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: ConfigPlaylists
Set the settings for processing remote playlists from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Bases: BaseConfig
Set the settings for synchronising remote playlists from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
DEFAULT = {} | Tags and values of items to filter out of every playlist when synchronising
+DEFAULT = ‘new’ | Sync option for the remote playlist.
+Merge the currently stored config values with the config from a given other
configured config object
+When override
is True, force overwrite any values in self
with other
.
DEFAULT = True | Reload playlists after synchronisation.
+Return a dictionary representation of the key attributes of this object.
+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
Return a dictionary representation of the key attributes of this object.
+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
An initialised remote wrangler
+An initialised library
+The RemotePlaylist
class for this remote library type
An initialised remote wrangler
+The name of the source currently being used for this library
+An initialised remote wrangler
+Bases: BaseConfig
Base class for settings reports settings.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
Bases: BaseConfig
, Iterable
[ConfigReportBase
]
Set the settings for all reports from a config file.
+See Config
for more documentation regarding operation.
settings – The loaded config from the config file.
+Return a dictionary representation of the key attributes of this object.
+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
Are any reports configured enabled
+Bases: ConfigAPI
Set up and return a valid API session for this remote source type.
+Return a dictionary representation of the key attributes of this object.
+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
OPTIONAL | The client ID to use when authorising access to the API.
+OPTIONAL | The client secret to use when authorising access to the API.
+DEFAULT = () | The scopes to use when authorising access to the API.
+Bases: object
Stores the key classes for a remote source
+ + +Bases: SyncifyError
Exception raised when processing config gives an exception.
+key – The key that caused the error.
value – The value that caused the error.
message – Explanation of the error.
Bases: dict
Extends dict to ignore missing keys when using format_map operations
+Bases: SyncifyError
, AttributeError
Exception raised for invalid attributes.
+Bases: SyncifyError
Exception raised when searching enums gives an exception.
+value – The value that caused the error.
message – Explanation of the error.
Bases: Exception
Generic base class for all Syncify-related errors
+Bases: SyncifyError
, KeyError
Exception raised for invalid keys.
+Bases: SyncifyError
, TypeError
Exception raised for invalid item types.
+Bases: SyncifyError
, ValueError
Exception raised for invalid values.
+Bases: Field
Bases: Field
Bases: Field
Bases: TrackFieldMixin
Represent all currently supported fields for objects of type LocalTrack
Bases: Field
Bases: TrackFieldMixin
Represent all currently supported fields for objects of type Track
Bases: TagField
Applies extra functionality to the TagField enum for TagField types relating to Track
types
Mapper to apply to the enum found during from_name()
and from_value()
calls,
+or from to_tag()
and to_tags()
calls
Applies the following mapping:
+TRACK
returns both TRACK_NUMBER
and TRACK_TOTAL
enums
DISC
returns both DISC_NUMBER
and DISC_TOTAL
enums
all other enums return the enum in a unit list
Generate a report on the items with a set of collections that have missing tags.
+collections – A collection of item collections to report on. +If a local library is given, use the albums of the library as the collections to report on.
tags – List of tags to consider missing.
match_all – When True, item counts as missing tags if item is missing all
of the given tags.
+When False, item counts as missing tags when missing only one of the given tags.
Report on collections by name which have items with missing tags.
+Generate a report on the differences between two library’s playlists.
+source – A source library object containing the source playlists, or a collection of playlists .
reference – A comparative library object or collection of playlists +containing the playlists to compare to the source’s playlists.
Report on extra, missing, and unavailable tracks for the reference library.
+Bases: LocalCollectionFiltered
[LocalTrack
], Album
[LocalTrack
]
Object representing a collection of tracks of an album.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+tracks – A list of loaded tracks.
name – The name of this album.
+If given, the object only stores tracks that match the album name
given.
+If None, the list of tracks given are taken to be all the tracks for this album.
remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on tracks. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
LocalCollectionError – If the given tracks contain more than one unique value for
+album
when name is None.
The most common artist on this album
+Return a dictionary representation of the key attributes of this object.
+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
Album is a compilation if over 50% of tracks are marked as compilation
+A date
object representing the release date of this album.
+Determined by the most common release date of all tracks on this album.
The most common release day of all tracks on this album
+Does this album have an image
+The images associated with this album in the form {image name: image link}
The most common release month of all tracks on this album
+Average rating of all tracks on this album
+The most common release year of all tracks on this album
+Bases: LocalCollectionFiltered
[LocalTrack
], Artist
[LocalTrack
]
Object representing a collection of tracks by a single artist.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+tracks – A list of loaded tracks.
name – The name of this artist.
+If given, the object only stores tracks that match the artist name
given.
+If None, the list of tracks given are taken to be all the tracks by this artist.
remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on tracks. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
LocalCollectionError – If the given tracks contain more than one unique value for
+artist
when name is None.
List of albums ordered by frequency of appearance on the tracks by this artist
+Return a dictionary representation of the key attributes of this object.
+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
Average rating of all tracks by this artist
+Bases: ItemCollection
, Generic
Generic class for storing a collection of local tracks.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on items. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
+List of artists ordered by frequency of appearance on the tracks in this collection
+Return a dictionary representation of the key attributes of this object.
+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
List of genres ordered by frequency of appearance on the tracks in this collection
+The tracks in this collection
+Timestamp of the track last added to the library in this collection
+Timestamp of the last modified track in this collection
+Timestamp of the last played track in this collection
+Total duration of all tracks in this collection in seconds
+Log stats from the results of a save_tracks
operation
Merge this collection with another collection or list of items +by performing an inner join on a given set of tags
+tracks – List of items or ItemCollection to merge with
tags – List of tags to merge on.
Total number of plays of all tracks in this collection
+Saves the tags of all tracks in this collection. Use arguments from LocalTrack.save()
tags – Tags to be updated.
replace – Destructively replace tags in each file.
dry_run – Run function, but do not modify file at all.
A map of the LocalTrack
saved to its result as a SyncResultTrack
object
Set of all unique track paths in this collection
+The total number of tracks in this collection
+The tracks in this collection
+Bases: LocalCollection
, Generic
Generic class for storing and filtering on a collection of local tracks +with methods for enriching the attributes of this object from the attributes of the collection of tracks
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+tracks – A list of loaded tracks.
name – The name of this collection. +If given, the object only stores tracks that match the name given on the attribute of this object. +If None, the list of tracks given are taken to be all the tracks contained in this collection.
remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on tracks. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
LocalCollectionError – If the given tracks contain more than one unique value +for the attribute of this collection when name is None.
+The name of the key property of this collection
+The tracks in this collection
+Bases: LocalCollectionFiltered
[LocalTrack
], Folder
[LocalTrack
]
Object representing a collection of tracks in a folder on the local drive
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+tracks – A list of loaded tracks.
name – The name of this folder.
+If given, the object only stores tracks that match the folder name
given.
+If None, the list of tracks given are taken to be all the tracks contained in this folder.
remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on tracks. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
LocalCollectionError – If the given tracks contain more than one unique value for
+folder
when name is None.
List of albums ordered by frequency of appearance on the tracks in this folder
+Return a dictionary representation of the key attributes of this object.
+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
Folder is a compilation if over 50% of tracks are marked as compilation
+Modify tags for tracks in the folders of this library.
+The following steps are applied to all non-compilation folders:
+Set compilation to False
The following steps are applied to all compilation folders:
+Set album name to folder name
Set album artist to ‘Various’
Set track_number in ascending order by filename
Set track_total to the number of tracks in the folder
Set disc_number to 1
Set disc_total to 1
Set compilation to True
Bases: LocalCollectionFiltered
[LocalTrack
], Genre
[LocalTrack
]
Object representing a collection of tracks within a genre.
+tag_sep – When representing a list of tags as a string, use this value as the separator.
+tracks – A list of loaded tracks.
name – The name of this genre.
+If given, the object only stores tracks that match the genre name
given.
+If None, the list of tracks given are taken to be all the tracks within this genre.
remote_wrangler – Optionally, provide a RemoteDataWrangler object for processing URIs on tracks. +If given, the wrangler can be used when calling __get_item__ to get an item from the collection from its URI.
LocalCollectionError – If the given tracks contain more than one unique value for
+genre
when name is None.
List of albums ordered by frequency of appearance on the tracks for this genre
+Return a dictionary representation of the key attributes of this object.
+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
Bases: MusicBeeError
Exception raised for errors related to MusicBee field.
+message – Explanation of the error.
+Bases: FileError
, FileNotFoundError
Exception raised when a file cannot be found.
+path – The path that caused the error.
message – Explanation of the error.
Bases: LocalError
Exception raised for file errors.
+file – The file type that caused the error.
message – Explanation of the error.
Bases: FileError
Exception raised for errors in loading an image.
+Bases: FileError
Exception raised for unrecognised file types.
+filetype – The file type that caused the error.
message – Explanation of the error.
Bases: LocalError
Exception raised for local collection errors.
+message – Explanation of the error.
kind – The collection type related to the error.
Bases: SyncifyError
Exception raised for local errors.
+message – Explanation of the error.
+Bases: LocalError
Exception raised for local item errors.
+message – Explanation of the error.
kind – The item type related to the error.
Bases: LocalError
Exception raised for errors related to track processors.
+Bases: LocalError
Exception raised for errors related to MusicBee logic.
+Bases: MusicBeeError
Exception raised for errors related to MusicBee a persistent ID.
+Bases: MusicBeeError
Exception raised for errors related to reading a MusicBee library XML file.
+Bases: Processor
Base class for implementations with :py:function:`dynamicprocessormethod` methods.
+Classes that implement this base class have a __processormethods__
class attribute
+which is a list of strings of all the processor methods this class contains.
+If a :py:function:`dynamicprocessormethod` has alternative method names, these names will be added
+to the class’ __dict__
as callable methods which point to the decorated method.
Optionally, you may also define a _processor_method_fmt
class method which
+applies some transformation to all method names.
+The transformed method name is then appended to the class’ __dict__
.
+The transformation is always applied before extending the class with any given
+alternative method names.
__processormethods__ – The set of processor methods on this processor and any alternative names for them.
+String representation of the current processor name of this object
+Bases: Processor
, PrettyPrinter
Base object for processing tracks in a playlist
+Bases: ItemProcessor
Initialise object from XML playlist data.
+xml – The loaded XML object for this playlist.
+Export this object’s settings to a map ready for export to an XML playlist file.
+Bases: object
Generic base class for processors
+Bases: object
Decorator for methods on a class decorated with the processor()
decorator
This assigns the method a processor method which can be dynamically called by the processor class. +Optionally, provide a list of alternative names from which this processor method can also be called.
+Bases: MusicBeeProcessor
, DynamicProcessor
Compares an item or object with another item, object or a given set of expected values to find a match.
+condition – The condition to match on e.g. Is, LessThan, InRange, Contains.
expected – Optional list of expected values to match on. +Types of the values in this list are automatically converted to the type of the item field’s value.
field – The field to match on.
Return a dictionary representation of the key attributes of this object.
+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
Compare a item
to a reference
or,
+if no reference
is given, to this object’s list of expected
values
True if a match is found, False otherwise.
+LocalProcessorError – If no reference given and no expected values set for this comparer.
+String representation of the current condition name of this object
+A list of expected values used for most conditions
+Initialise object from XML playlist data.
+xml – The loaded XML object for this playlist.
+Export this object’s settings to a map ready for export to an XML playlist file.
+Bases: ItemProcessorError
Exception raised for errors related to item comparer settings.
+Bases: ItemProcessorError
Exception raised for errors related to item limit settings.
+Bases: ItemProcessorError
Exception raised for errors related to item matcher settings.
+Bases: ProcessorError
Exception raised for errors related to ItemProcessor logic.
+Bases: ItemProcessorError
Exception raised for errors related to item sorter settings.
+Bases: SyncifyError
Exception raised for errors related to processors.
+Bases: ProcessorError
Exception raised when processor name given is not valid.
+Bases: ProcessorError
Exception raised for errors related to TimeMapper.
+Bases: MusicBeeProcessor
, DynamicProcessor
Sort items in-place based on given conditions.
+limit – The number of items to limit to. A value of 0 applies no limiting.
on – The type to limit on e.g. items, albums, minutes.
sorted_by – When limiting, sort the collection of items by this function first.
allowance – When limiting on bytes or length, add this extra allowance factor to +the max size limit on comparison. +e.g. say the limiter currently has 29 minutes worth of songs in its final list and the max limit is 30 minutes. +The limiter has to now consider whether to include the next song it sees with length 3 minutes. +With an allowance of 0, this song will not be added. +However, with an allowance of say 1.33 it will as the max limit for this comparison becomes 30 * 1.33 = 40. +Now, with 32 minutes worth of songs in the final playlist, the limit is >30 minutes and the limiter stops +processing.
Return a dictionary representation of the key attributes of this object.
+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
Initialise object from XML playlist data.
+xml – The loaded XML object for this playlist.
+Limit items
in-place based on set conditions.
items – The list of items to limit.
ignore – list of items to ignore when limiting. i.e. keep them in the list regardless.
String representation of the sorting method to use before limiting
+Export this object’s settings to a map ready for export to an XML playlist file.
+Bases: SyncifyEnum
Represents the possible limit types to apply when filtering a playlist.
+Bases: PrettyPrinter
Config for processing string-type tag values before matching with ItemMatcher
tag – The name of the tag to clean.
_remove – A set of string values to remove from this tag.
_split – A set of string values for which the cleaner will +slice the tag on and remove anything that comes after.
_preprocess – A function to apply before the _remove and _split values are applied.
Return a dictionary representation of the key attributes of this object.
+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
Apply the preprocess function to value if given, return value unprocessed if not
+Get all redundant words to be removed for this tag
+Get all split words for which the cleaner will only take words before this word
+Bases: ItemProcessor
Matches source items/collections to given result(s).
+karaoke_tags – A set of words to search for in tag values that identify the item as being a karaoke item.
year_range – A difference in years of this value gives a score of 0 for the match_year()
algorithm.
+See the match_year()
method for more information.
clean_tags_remove_all – Apply these remove settings to all tags
+when processing tags as per clean_tags()
method.
+See also CleanTagConfig
for more info on this configuration.
clean_tags_split_all – Apply these split settings to all tags
+when processing tags as per clean_tags()
method.
+See also CleanTagConfig
for more info on this configuration.
clean_tags_config – A list of configurations in the form of CleanTagConfig
+to apply for each tag type. See also CleanTagConfig
for more info.
reduce_name_score_on – A set of words to check for when applying name score reduction logic.
+If a word from this list is present in the name of the result to score against
+but not in the source Item
, reduce the score for the name match by
+the _reduce_name_score_factor
.
+This set is always combined with the karaoke_tags
.
reduce_name_score_factor – The factor to reduce a name score on when a word from
+_reduce_name_score_on
is found in the result but not in the source Item
.
Return a dictionary representation of the key attributes of this object.
+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
Clean tags on the input item and assign to its clean_tags
attribute. Used for better matching/searching.
+Clean by removing words, and only taking phrases before a certain word e.g. ‘featuring’, ‘part’.
+Cleaning config for string-type tags is set in _clean_tags_config
.
source – The base object with tags to clean.
+Perform match algorithm for a given item and its results.
+source – Source item to compare against and find a match for.
results – Results for comparisons.
min_score – Only return the result as a match if the score is above this value. +Value will be limited to between 0.01 and 1.0.
max_score – Stop matching once this score has been reached. +Value will be limited to between 0.01 and 1.0.
match_on – List of tags to match on. Currently only the following fields are supported: +title, artist, album, year, length.
allow_karaoke – When True, items determined to be karaoke are allowed when matching added items.
+Skip karaoke results otherwise. Karaoke items are identified using the karaoke_tags
attribute.
The item that matched best if found, None if no item matched conditions.
Match on album and return a score between 0-1. Score=0 when either value is None.
+Match on artists and return a score between 0-1. Score=0 when either value is None. +When many artists are present, a scale factor is applied to the score of matches on subsequent artists. +i.e. match on artist 1 is scaled by 1, match on artist 2 is scaled by 1/2, +match on artist 3 is scaled by 1/3 etc.
+Match on length and return a score between 0-1. Score=0 when either value is None.
+Match on names and return a score between 0-1. Score=0 when either value is None.
+Checks if a result is not a karaoke item that is either 0 when item is karaoke or 1 when not karaoke.
+Match on year and return a score between 0-1. Score=0 when either value is None.
+Matches within year_range
years on a 0-1 scale where 1 is the exact same year
+and 0 is a difference in year greater that year_range
.
+User may modify this max range via the year_range
class attribute.
Bases: MusicBeeProcessor
Sort items in-place based on given conditions.
+_custom_sort – Settings for custom sort codes.
+fields –
When None and ShuffleMode is RANDOM, shuffle the items. Otherwise, do nothing.
List of tags/properties to sort by.
Map of {tag/property
: reversed
}. If reversed is true, sort the tag/property
in reverse.
shuffle_mode – The mode to use for shuffling.
shuffle_by – The field to shuffle by when shuffling.
shuffle_weight – The weights (between 0 and 1) to apply to shuffling modes that can use it. +This value will automatically be limited to within the accepted range 0 and 1.
Return a dictionary representation of the key attributes of this object.
+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
Initialise object from XML playlist data.
+xml – The loaded XML object for this playlist.
+Group items by the values of a given field.
+items – List of items to sort.
field – Tag or property to group by. None returns map of {None
: items
}.
Map of grouped items.
+Sorts a list of items
in-place.
Sort items by the values of a given field.
+items – List of items to sort
field – Tag or property to sort on. If None and reverse is True, reverse the order of the list.
reverse – If true, reverse the order of the sort.
Export this object’s settings to a map ready for export to an XML playlist file.
+Bases: SyncifyEnum
Represents the possible items/properties to shuffle by when shuffling items in a playlist.
+Bases: SyncifyEnum
Represents the possible shuffle modes to use when shuffling items in a playlist.
+Bases: DynamicProcessor
, PrettyPrinter
Map of time character representation to it unit conversion from seconds
+Return a dictionary representation of the key attributes of this object.
+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
Call self as a function.
+Call self as a function.
+Run the mapping function
+Call self as a function.
+Call self as a function.
+Call self as a function.
+Call self as a function.
+ItemCheckResult
+RemoteItemChecker
RemoteItemChecker.allow_karaoke
RemoteItemChecker.api
RemoteItemChecker.check()
RemoteItemChecker.final_skipped
RemoteItemChecker.final_switched
RemoteItemChecker.final_unavailable
RemoteItemChecker.interval
RemoteItemChecker.playlist_name_collection
RemoteItemChecker.playlist_name_urls
RemoteItemChecker.quit
RemoteItemChecker.remaining
RemoteItemChecker.skip
RemoteItemChecker.switched
ItemSearchResult
+RemoteItemSearcher
+SearchSettings
+Bases: RemoteDataWrangler
Collection of endpoints for a remote API.
+See RequestHandler
and APIAuthoriser
+for more info on which params to pass to authorise and execute requests.
handler_kwargs – The authorisation kwargs to be passed to APIAuthoriser
.
POST
- Add list of tracks to a given playlist.
playlist – One of the following to identify the playlist to clear: +- playlist URL/URI/ID, +- the name of the playlist in the current user’s playlists, +- the API response of a playlist.
items – List of URLs/URIs/IDs of the tracks to add.
limit – Size of each batch of IDs to add. This value will be limited to be between 1
and 50
.
skip_dupes – Skip duplicates.
The number of tracks added to the playlist.
+RemoteIDTypeError – Raised when the input playlist
does not represent
+a playlist URL/URI/ID.
RemoteObjectTypeError – Raised when the item types of the input items
+are not all tracks or IDs.
The base URL for making calls to the remote API
+Main method for authorisation, tests/refreshes/reauthorises as needed
+force_load – Reloads the token even if it’s already been loaded into the object. +Ignored when force_new is True.
force_new – Ignore saved/loaded token and generate new token.
Self.
+APIError – If the token cannot be validated.
+DELETE
- Clear tracks from a given playlist.
+WARNING: This function can destructively modify your remote playlists.
playlist – One of the following to identify the playlist to clear: +- playlist URL/URI/ID, +- the name of the playlist in the current user’s playlists, +- the API response of a playlist.
items – List of URLs/URIs/IDs of the tracks to remove. If None, clear all songs from the playlist.
limit – Size of each batch of IDs to clear in a single request.
+This value will be limited to be between 1
and 100
.
The number of tracks cleared from the playlist.
+RemoteIDTypeError – Raised when the input playlist
does not represent
+a playlist URL/URI/ID.
RemoteObjectTypeError – Raised when the item types of the input items
+are not all tracks or IDs.
POST
- Create an empty playlist for the current user with the given name.
name – Name of playlist to create.
+API URL for playlist.
+DELETE
- Unfollow/delete a given playlist.
+WARNING: This function will destructively modify your remote playlists.
playlist – One of the following to identify the playlist to clear: +- playlist URL/URI/ID, +- the name of the playlist in the current user’s playlists, +- the API response of a playlist.
+API URL for playlist.
+Extend the items for a given items_block
API response.
+The function requests each page of the collection returning a list of all items
+found across all pages for this URL.
Updates the value of the items
key in-place by extending the value of the items
key with new results.
items_block – A remote API JSON response for an items type endpoint.
kind – The type of response being extended. Optional, used only for logging.
key – The type of response of the child objects.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
API JSON responses for each item
++++
GET: /{kind}s
- Get information for givenvalues
.+
+values
may be:- +
+
+- +
A string representing a URL/URI/ID.
- +
A MutableSequence of strings representing URLs/URIs/IDs of the same type.
- +
A remote API JSON response for a collection.
- +
A MutableSequence of remote API JSON responses for a collection.
If JSON response/s given, this update each response given by merging with the new response.
++
+- param values:
+- +
The values representing some remote objects. See description for allowed value types. +These items must all be of the same type of item i.e. all tracks OR all artists etc.
+- param kind:
+- +
Item type if given string is ID.
+- param limit:
+- +
When requests can be batched, size of batches to request. +This value will be limited to be between
+1
and50
.- param extend:
+- +
When True and the given
+kind
is a collection of items, +extend the response to include all items in this collection.
use_cache –
Use the cache when calling the API endpoint. Set as False to refresh the cached response. +:return: API JSON responses for each item. +:raise RemoteObjectTypeError: Raised when the function cannot determine the item type
+++ +of the input
+values
. Or when it does not recognise the type of the inputvalues
parameter.
Determine the type of the given playlist
and return its API URL.
+If type cannot be determined, attempt to find the playlist in the
+list of the currently authenticated user’s playlists.
playlist – In URL/URI/ID form, or the name of one of the currently authenticated user’s playlists.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
The playlist URL.
+RemoteIDTypeError – Raised when the function cannot determine the item type of
+the input playlist
. Or when it does not recognise the type of the input playlist
parameter.
GET
- Get API response for information on current user
update_user_data – When True, update the _user_data
stored in this API object.
Wrapper for get_items()
which only returns Track type responses.
+See get_items()
for more info.
GET
- Get saved items for a given user.
user – The ID of the user to get playlists for. If None, use the currently authenticated user.
kind – Item type to retrieve for the user.
limit – Size of each batch of items to request in the collection items request.
+This value will be limited to be between 1
and 50
.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
API JSON responses for each collection.
+RemoteIDTypeError – Raised when the input user
does not represent a user URL/URI/ID.
RemoteObjectTypeError – When the given kind
is not a valid user item/collection.
Load and store user data in this API object for the currently authorised user
+Diagnostic function.
+Print tracks from a given link in <track> - <title> | <URI> - <URL>
format for a given URL/URI/ID.
value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote collection. See description for allowed value types.
kind – When an ID is provided, give the kind of ID this is here. +If None and ID is given, user will be prompted to give the kind anyway.
limit – The number of results to call per request and, +therefore, the number of items in each printed block.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
Pretty print item data for displaying to the user.
+i – The position of this item in the collection.
name – The name of the item.
uri – The URI of the item.
length – The duration of the item in seconds.
total – The total number of items in the collection
max_width – The maximum width to print names as. Any name lengths longer than this will be truncated.
GET
- Query for items. Modify result types returned with kind parameter
query – Search query.
kind – The remote object type to search for.
limit – Number of results to get and return.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
The response from the endpoint.
+ID of the currently authorised user
+Name of the currently authorised user
+Bases: RemoteObject
, Item
Generic base class for remote items. Extracts key data from a remote API JSON response.
+Bases: NamedObjectPrinter
, Remote
Generic base class for remote objects. Extracts key data from a remote API JSON response.
+response – The remote API JSON response
api – The instantiated and authorised API object for this source type.
Return a dictionary representation of the key attributes of this object.
+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
Does this item/collection have a valid URI that is not a local URI.
+The ID of this item/collection.
+Generate a new object of this class, +calling all required endpoints to get a complete set of data for this item type.
+value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote object. See description for allowed value types.
api – An authorised API object to load the object from.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
Refresh this object by updating from the stored API response. +Useful for updating stored variables after making changes to the stored API response manually.
+Reload this object from the API, calling all required endpoints +to get a complete set of data for this item type
+use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
+The API response for this object
+The URI of this item/collection.
+The API URL of this item/collection.
+The external URL of this item/collection.
+Bases: object
Stores the key object classes for a remote source
+Bases: SyncifyEnum
Represents remote ID type
+Bases: SyncifyEnum
Represents remote object types
+Bases: SyncifyError
Exception raised for remote errors
+Bases: RemoteError
Exception raised for remote ID type errors.
+message – Explanation of the error.
kind – The ID type related to the error.
Bases: RemoteError
Exception raised for remote object type errors.
+message – Explanation of the error.
kind – The item type related to the error.
Bases: Library
, RemoteCollection
, Generic
Represents a remote library, providing various methods for manipulating +tracks and playlists across an entire remote library collection.
+api – An authorised API object for the authenticated user you wish to load the library from.
include – An optional list of playlist names to include when loading playlists.
exclude – An optional list of playlist names to exclude when loading playlists.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
The saved albums in this library
+Authorised API object for making authenticated calls to a user’s library
+The saved artists in this library
+Return a dictionary representation of the key attributes of this object.
+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
Produce a backup map of <playlist name>: [<URIs] for all playlists in this library +which can be saved to JSON for backup purposes.
+Call API to enrich elements of user’s saved album objects improving metadata coverage. +This is an optionally implementable method. Defaults to doing nothing.
+Call API to enrich elements of user’s saved artist objects improving metadata coverage. +This is an optionally implementable method. Defaults to doing nothing.
+Call API to enrich elements of track objects improving metadata coverage. +This is an optionally implementable method. Defaults to doing nothing.
+Append many items to the items in this collection
+The user ID associated with this library
+Return a dictionary representation of the key attributes of this object that is safe to output to JSON
+Loads all data from the remote API for this library and log results.
+Load all playlists from the API that match the filter rules in this library. Also loads all their tracks. +WARNING: Overwrites any currently loaded playlists.
+Load all user’s saved albums from the API. +Updates currently loaded albums in-place or appends if not already loaded.
+Load all user’s saved artists from the API. +Updates currently loaded artists in-place or appends if not already loaded.
+Load all user’s saved tracks from the API. +Updates currently loaded tracks in-place or appends if not already loaded.
+Log stats on currently loaded albums
+Log stats on currently loaded artists
+Log stats on currently loaded playlists
+Log stats from the results of a sync
operation
Log stats on currently loaded tracks
+The username associated with this library
+The playlists in this library
+Restore playlists from a backup to loaded playlist objects.
+This function does not sync the updated playlists with the remote library.
+When dry_run
is False, this function does create new playlists on the remote library for playlists
+given that do not exist in this Library.
playlists – Values that represent the playlists to restore from.
dry_run – When True, do not create playlists +and just skip any playlists that are not already currently loaded.
Synchronise this playlist object with the remote playlist it is associated with. Clear options:
+from this playlist object not currently in the remote playlist.
+‘refresh’: Clear all items from the remote playlist first, then add all items from this playlist object.
from this playlist object not currently in the remote playlist.
+playlists – Provide a library, map of playlist name to playlist or collection of playlists
+to synchronise to the remote library.
+Use the currently loaded playlists
in this object if not given.
kind – Sync option for the remote playlist. See description.
reload – When True, once synchronisation is complete, reload this RemotePlaylist object +to reflect the changes on the remote playlist if enabled. Skip if False.
dry_run – Run function, but do not modify the remote playlists at all.
Map of playlist name to the results of the sync as a SyncResultRemotePlaylist
object.
The tracks in this library
+Bases: Album
, RemoteCollectionLoader
, Generic
Extracts key album
data from a remote API JSON response.
List of artists ordered by frequency of appearance on the tracks on this album
+Bases: Artist
, RemoteCollectionLoader
, Generic
Extracts key artist
data from a remote API JSON response.
List of albums ordered by frequency of appearance on the tracks by this artist
+List of other artists ordered by frequency of appearance on the albums by this artist
+Does this artist have images associated with them
+The images associated with this artist in the form {image name: image link}
Total duration of all tracks by this artist
+The total number of tracks by this artist
+The tracks by this artist
+Bases: ItemCollection
, RemoteDataWrangler
, Generic
Generic class for storing a collection of remote objects.
+Bases: RemoteObject
, RemoteCollection
, Generic
Generic class for storing a collection of remote objects that can be loaded from an API response.
+Generate a new object, calling all required endpoints to get a complete set of data for this item type.
+value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote collection. See description for allowed value types.
api – An authorised API object to load the object from.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
items – Optionally, give a list of available items to build a response for this collection. +In doing so, the method will first try to find the API responses for the items of this collection +in the given list before calling the API for any items not found there. +This helps reduce the number of API calls made on initialisation.
Bases: RemoteItem
, RemoteDataWrangler
, Generic
Bases: Playlist
, RemoteCollectionLoader
, Generic
Extracts key playlist
data from a remote API JSON response.
Create an empty playlist for the current user with the given name +and initialise and return a new RemotePlaylist object from this new playlist.
+api – An API object with authorised access to a remote User to create playlists for.
name – Name of playlist to create.
public – Set playlist availability as public if True and private if False.
collaborative – Set playlist to collaborative i.e. other users may edit the playlist.
RemotePlaylist
object for the generated playlist.
A map of {URI: date}
for each item for when that item was added to the playlist
Unfollow/delete the current playlist and clear the stored response for this object. +WARNING: This function will destructively modify your remote playlists.
+The number of followers this playlist has
+Merge tracks in this playlist with another playlist synchronising tracks between the two. +Only modifies this playlist.
+The ID of the owner of this playlist
+The name of the owner of this playlist
+Synchronise this playlist object’s items with the remote playlist it is associated with. Sync options:
+from this playlist object not currently in the remote playlist.
+‘refresh’: Clear all items from the remote playlist first, then add all items from this playlist object.
from this playlist object not currently in the remote playlist.
+items – Provide an item collection or list of items to synchronise to the remote playlist.
+Use the currently loaded tracks
in this object if not given.
kind – Sync option for the remote playlist. See description.
reload – When True, once synchronisation is complete, reload this RemotePlaylist object +to reflect the changes on the remote playlist if enabled. Skip if False.
dry_run – Run function, but do not modify the remote playlists at all.
The results of the sync as a SyncResultRemotePlaylist
object.
Is this playlist writeable i.e. can this program modify it
+Bases: RemoteItemWranglerMixin
, Track
Extracts key track
data from a remote API JSON response.
Bases: Result
Stores the results of a sync with a remote playlist
+start – The total number of tracks in the playlist before the sync.
added – The number of tracks added to the playlist.
removed – The number of tracks removed from the playlist.
unchanged – The number of tracks that were in the playlist before and after the sync.
difference – The difference between the total number tracks in the playlist from before and after the sync.
final – The total number of tracks in the playlist after the sync.
Bases: Result
Stores the results of the checking proces
+switched – Sequence of Items that had URIs switched during the check.
unavailable – Sequence of Items that were marked as unavailable.
skipped – Sequence of Items that were skipped from the check.
Bases: RemoteDataWrangler
, ItemMatcher
Runs operations for checking the URIs associated with a collection of items.
+When running check()
, the object will do the following:
interval
limit of playlists.At which point, playlist creation pauses.
+User can then check and modify the temporary playlists to match items to correct items or otherwise.
attempt to match any new items to a source item.
+to determine how they wish to deal with these items.
+Operation completes once user exists or all items have an associated URI.
api – An API object with authorised access to a remote User to create playlists for.
interval – Stop creating playlists after this many playlists have been created and pause for user input.
Run the following operations to check a list of ItemCollections on the remote application.
+interval
limit of playlists.At which point, playlist creation pauses.
+User can then check and modify the temporary playlists to match items to correct items or otherwise.
attempt to match any new items to a source item.
+to determine how they wish to deal with these items.
+Operation completes once user exists or all items have an associated URI.
collections – A list of collections to check.
+A ItemCheckResult
object containing the remapped items created during the check.
+Return None when the user opted to quit (not skip) the checker before completion.
Bases: Result
Stores the results of the searching process
+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.
Bases: Remote
, ItemMatcher
Searches for remote matches for a list of item collections.
+api – An API object for calling the remote query endpoint.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
Searches for remote matches for the given list of item collections.
+Map of the collection’s name to its ItemSearchResult
object.
Bases: object
Key settings related to a search algorithm.
+search_fields_1 – A list 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 list 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 list of the tag names to use as search fields in the 3rd pass.
match_fields – The fields to match results on.
result_count – The number of the results to request when querying the API.
allow_karaoke – When True, items determined to be karaoke are allowed when matching added items. +Skip karaoke results otherwise.
min_score – The minimum acceptable score for an item to be considered a match.
min_score – 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.
Bases: Remote
Converts ID to required format - API URL, EXT URL, URI, or ID.
+value – URL/URI/ID to convert.
kind – Optionally, give the item type of the input value
to skip some checks.
+This is required when the given value
is an ID.
type_in – Optionally, give the ID type of the input value
to skip some checks.
type_out – The ID type of the output value
.
Formatted string.
+RemoteIDTypeError – Raised when the function cannot determine the item type
+of the input value
.
Extract a list of IDs from input values
.
values
may be:A string representing a URL/URI/ID.
A MutableSequence of strings representing URLs/URIs/IDs of the same type.
a valid ID value under an id
key,
a valid item type value under a type
key if kind
is None.
A MutableSequence of remote API JSON responses for a collection including the same structure as above.
values – The values representing some remote objects. See description for allowed value types. +These items may be of mixed item types e.g. some tracks AND some artists.
kind – Optionally, give the item type of the input value
to skip some checks.
+This is required when the given value
is an ID.
List of IDs.
+RemoteError – Raised when the function cannot determine the item type of the input values
.
+Or when it does not recognise the type of the input values
parameter.
Determine the remote ID type of the given value
and return its type.
value – URL/URI/ID to check.
kind – When this is equal to USER
, ignore checks and always return ID
as type.
The RemoteIDType
.
RemoteIDTypeError – Raised when the function cannot determine the ID type
+of the input value
.
Determine the remote object type of values
.
values
may be:A string representing a URL/URI/ID.
A MutableSequence of strings representing URLs/URIs/IDs of the same type.
A remote API JSON response for a collection including a valid item type value under a type
key.
A MutableSequence of remote API JSON responses for a collection including the same structure as above.
values – The values representing some remote objects. See description for allowed value types. +These items must all be of the same type of item to pass i.e. all tracks OR all artists etc.
kind – The RemoteObjectType
if the value is found to be an ID.
RemoteObjectType
RemoteObjectTypeError – Raised when the function cannot determine the item type
+of the input values
.
+Or when the list contains strings representing many differing remote object types or only IDs.
The value to use as a URI for an item which does not have an associated remote object. +An item that has this URI value will be excluded from most remote logic.
+Check that the given value
is a type of remote ID given by ``kind ``
Check that the given values
is a type of item given by ``kind `` or a simple ID.
values
may be:A string representing a URL/URI/ID.
A MutableSequence of strings representing URLs/URIs/IDs of the same type.
A remote API JSON response for a collection including a valid item type value under a type
key.
A MutableSequence of remote API JSON responses for a collection including the same structure as above.
values – The values representing some remote objects. See description for allowed value types. +These items must all be of the same type of item to pass i.e. all tracks OR all artists etc.
kind – The remote object type to check for.
RemoteObjectTypeError – Raised when the function cannot validate the item type
+of the input values
is of type kind
or a simple ID.
SpotifyItemChecker
SpotifyItemChecker.allow_karaoke
SpotifyItemChecker.api
SpotifyItemChecker.final_skipped
SpotifyItemChecker.final_switched
SpotifyItemChecker.final_unavailable
SpotifyItemChecker.interval
SpotifyItemChecker.playlist_name_collection
SpotifyItemChecker.playlist_name_urls
SpotifyItemChecker.quit
SpotifyItemChecker.remaining
SpotifyItemChecker.skip
SpotifyItemChecker.switched
SpotifyItemSearcher
+Bases: RemoteItem
, SpotifyObject
Generic base class for Spotify-stored items. Extracts key data from a Spotify API JSON response.
+Bases: SpotifyObjectMixin
, PrettyPrinter
Generic base class for Spotify-stored objects. Extracts key data from a Spotify API JSON response.
+Does this item/collection have a valid URI that is not a local URI.
+The ID of this item/collection.
+The URI of this item/collection.
+The API URL of this item/collection.
+The external URL of this item/collection.
+Bases: RemoteObject
, SpotifyRemote
Bases: SpotifyError
Exception raised for local collection errors.
+message – Explanation of the error.
kind – The collection type related to the error.
Bases: RemoteError
Exception raised for Spotify ID errors.
+message – Explanation of the error.
+Bases: SpotifyError
Exception raised for local item errors.
+message – Explanation of the error.
kind – The item type related to the error.
Bases: RemoteLibrary
[SpotifyTrack
], SpotifyCollection
[SpotifyTrack
]
Represents a Spotify library, providing various methods for manipulating +tracks and playlists across an entire Spotify library collection.
+The saved albums in this library
+Authorised API object for making authenticated calls to a user’s library
+The saved artists in this library
+Extends the tracks data for currently loaded albums, getting all available tracks data for each album
+Gets all albums for current loaded following artists.
+tracks – When True, also get all tracks for each album.
types – Provide a list of albums types to get to limit the types of albums loaded.
Select from {"album", "single", "compilation", "appears_on"}
.
Enriches the features
, analysis
, albums
, and/or artists
data for currently loaded tracks.
features – Load all audio features (e.g. BPM, tempo, key etc.)
analysis – Load all audio analyses (technical audio data). +WARNING: can be very slow as calls to this endpoint cannot be batched i.e. one call per track.
albums – Reload albums for all tracks, adding extra album data e.g. genres, popularity
artists – Reload artists for all tracks, adding extra artist data e.g. genres, popularity, followers
Merge playlists from given list/map/library to this library
+The playlists in this library
+Bases: RemoteAlbum
[SpotifyTrack
], SpotifyCollectionLoader
[SpotifyTrack
]
Extracts key album
data from a Spotify API JSON response.
response – The Spotify API JSON response
+The album artist for this album
+Joined string representation of all artists on this album ordered by frequency of appearance
+List of artists ordered by frequency of appearance on the tracks on this album
+Is this album a compilation
+The day this album was released
+List of genres ordered by frequency of appearance on the tracks on this album
+Does this album have an image
+The images associated with this album in the form {image name: image link}
Total duration of all tracks on this album in seconds
+The month this album was released
+The album name
+Rating of this album
+Refresh this object by updating from the stored API response. +Useful for updating stored variables after making changes to the stored API response manually.
+Reload this object from the API, calling all required endpoints +to get a complete set of data for this item type
+use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
+The total number of tracks on this album
+The tracks on this album
+The year this album was released
+Bases: RemoteArtist
[SpotifyAlbum
], SpotifyCollectionLoader
[SpotifyAlbum
]
Extracts key artist
data from a Spotify API JSON response.
List of albums ordered by frequency of appearance on the tracks by this artist
+The artist name
+The total number of followers for this artist
+List of genres for this artist
+The images associated with this artist in the form {image name: image link}
The albums this artist is featured on
+Generate a new object, calling all required endpoints to get a complete set of data for this item type.
+value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote collection. See description for allowed value types.
api – An authorised API object to load the object from.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
items – Optionally, give a list of available items to build a response for this collection. +In doing so, the method will first try to find the API responses for the items of this collection +in the given list before calling the API for any items not found there. +This helps reduce the number of API calls made on initialisation.
The artist name
+The popularity of this artist
+Refresh this object by updating from the stored API response. +Useful for updating stored variables after making changes to the stored API response manually.
+Reload this object from the API, calling all required endpoints +to get a complete set of data for this item type
+use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
+Bases: RemoteCollection
, SpotifyDataWrangler
, Generic
Generic class for storing a collection of Spotify objects.
+Bases: SpotifyObjectLoaderMixin
, SpotifyCollection
, Generic
Generic class for storing a collection of Spotify objects that can be loaded from an API response.
+Generate a new object, calling all required endpoints to get a complete set of data for this item type.
+value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote collection. See description for allowed value types.
api – An authorised API object to load the object from.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
items – Optionally, give a list of available items to build a response for this collection. +In doing so, the method will first try to find the API responses for the items of this collection +in the given list before calling the API for any items not found there. +This helps reduce the number of API calls made on initialisation.
Bases: SpotifyItem
, SpotifyDataWrangler
Bases: RemoteCollectionLoader
, SpotifyObject
, Generic
Mixin for RemoteCollectionLoader
and SpotifyObject
Bases: RemotePlaylist
[SpotifyTrack
], SpotifyCollectionLoader
[SpotifyTrack
]
Extracts key playlist
data from a Spotify API JSON response.
response – The Spotify API JSON response
+Are other users allowed to modify this playlist
+A map of {URI: date}
for each item for when that item was added to the playlist
datetime
object representing when the first track was added to this playlist
datetime
object representing when a track was most recently added/removed
Description of this playlist
+The number of followers this playlist has
+Does this playlist have an image
+The images associated with this playlist in the form {image name: image link}
The name of this playlist
+The ID of the owner of this playlist
+The name of the owner of this playlist
+Can other users access this playlist
+Refresh this object by updating from the stored API response. +Useful for updating stored variables after making changes to the stored API response manually.
+Reload this object from the API, calling all required endpoints +to get a complete set of data for this item type
+use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
+The total number of tracks in this playlist
+The tracks in this playlist
+Bases: SpotifyItemWranglerMixin
, RemoteTrack
Extracts key track
data from a Spotify API JSON response.
response – The Spotify API JSON response.
+The album this track is featured on
+The artist of the album this track is featured on
+Joined string representation of all artists featured on this track
+List of all artists featured on this track.
+The tempo of this track
+Comments associated with this track set by the user
+Is the album this track is featured on a compilation
+The day this track was released
+The number of the disc from the album this track is featured on
+The total number the discs from the album this track is featured on
+List of genres for the album this track is featured on. +If not found, genres from the main artist are given.
+Does the album this track is associated with have an image
+The images associated with the album this track is featured on in the form {image name: image link}
The key of this track in alphabetical musical notation format
+Total duration of this track in seconds
+Generate a new object of this class, +calling all required endpoints to get a complete set of data for this item type.
+value
may be:A string representing a URL/URI/ID.
A remote API JSON response for a collection with a valid ID value under an id
key.
value – The value representing some remote object. See description for allowed value types.
api – An authorised API object to load the object from.
use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
The month this track was released
+A name for this object
+The rating for this track
+Refresh this object by updating from the stored API response. +Useful for updating stored variables after making changes to the stored API response manually.
+Reload this object from the API, calling all required endpoints +to get a complete set of data for this item type
+use_cache – Use the cache when calling the API endpoint. Set as False to refresh the cached response.
+This track’s title
+The position this track has on the album it is featured on
+The track number of tracks on the album this track is featured on
+The year this track was released
+Bases: SpotifyDataWrangler
, RemoteItemChecker
Bases: SpotifyDataWrangler
, RemoteItemSearcher
Bases: RemoteDataWrangler
, SpotifyRemote
Converts ID to required format - API URL, EXT URL, URI, or ID.
+value – URL/URI/ID to convert.
kind – Optionally, give the item type of the input value
to skip some checks.
+This is required when the given value
is an ID.
type_in – Optionally, give the ID type of the input value
to skip some checks.
type_out – The ID type of the output value
.
Formatted string.
+RemoteIDTypeError – Raised when the function cannot determine the item type
+of the input value
.
Extract a list of IDs from input values
.
values
may be:A string representing a URL/URI/ID.
A MutableSequence of strings representing URLs/URIs/IDs of the same type.
a valid ID value under an id
key,
a valid item type value under a type
key if kind
is None.
A MutableSequence of remote API JSON responses for a collection including the same structure as above.
values – The values representing some remote objects. See description for allowed value types. +These items may be of mixed item types e.g. some tracks AND some artists.
kind – Optionally, give the item type of the input value
to skip some checks.
+This is required when the given value
is an ID.
List of IDs.
+RemoteError – Raised when the function cannot determine the item type of the input values
.
+Or when it does not recognise the type of the input values
parameter.
Determine the remote ID type of the given value
and return its type.
value – URL/URI/ID to check.
kind – When this is equal to USER
, ignore checks and always return ID
as type.
The RemoteIDType
.
RemoteIDTypeError – Raised when the function cannot determine the ID type
+of the input value
.
Check that the given value
is a type of remote ID given by ``kind ``
Align string with space padding. Truncate any string longer than max width with …
+Correct separators in the given path
to match those used by the current platform
Flatten the final layers of the values of a nested map to a single list
+Get max width of given list of values
for column-aligned logging
Get an ordered list of the most common values for a given collection of values
Print formatted dialog with optional text and get the user’s input.
+Limit a given value
to always be between some floor
and ceil
Recursively update a given source
map in place with a new
map.
source – The source map.
new – The new map with values to update for the source map.
extend – When a value is a list and a list is already present in the source map, extend the list when True. +When False, only replace the list if overwrite is True.
overwrite – When True, overwrite any value in the source list destructively.
The updated dict.
+Apply a format_map
to a given value
ignoring missing keys.
+If value
is a map, apply the format_map
recursively.
Remove ignorable words from the beginning of a string. +Useful for sorting collections strings with ignorable start words and/or special characters. +Only removes the first word it finds at the start of the string.
+Tuple of (True if the string starts with some special character, the formatted string)
+Safely turn any object into a collection of a given type T
.
+Strings are converted to collections of size 1 where the first element is the string.
+Returns None if value is None.
Returns a copy of the given value
that contains only unique elements.
+Useful for producing unique lists whilst preserving order.
Bases: BaseRotatingHandler
filename – The full path to the log file. +Optionally, include a ‘{}’ part in the path to format in the current datetime. +When None, defaults to ‘{}.log’
encoding – When not None, it is used to open the file with that encoding.
when – The timespan for ‘interval’ which is used together to calculate the timedelta.
+Accepts same values as TimeMapper
.
interval – The multiplier for when
.
+When combined with when
, gives the negative timedelta relative to now
+which is the maximum datetime to keep logs for.
count – The maximum number of files to keep.
delay – When True, the file opening is deferred until the first call to emit().
errors – Used to determine how encoding errors are handled.
Rotates the files in the folder on the given unformatted
path.
+Removes files older than self.delta
and the oldest files when number of files >= count
+until number of files <= count. formatted
path is excluded from processing.
Always returns False. Rotation happens on __init__ and only needs to happen once.
+Bases: Filter
Filter for logging to the console.
+Determine if the specified record is to be logged.
+Returns True if the record should be logged, or False otherwise. +If deemed appropriate, the record may be modified in-place.
+Bases: Filter
Filter for logging to a file.
+Determine if the specified record is to be logged.
+Returns True if the record should be logged, or False otherwise. +If deemed appropriate, the record may be modified in-place.
+Bases: Logger
The logger for all logging operations in Syncify.
+Get a list of the paths of all file handlers for this logger
+Wrapper for tqdm progress bar. For kwargs, see tqdm_std
Log ‘msg % args’ with severity ‘INFO_EXTRA’.
+Print a new line only when DEBUG < logger level
<= level
for all console handlers
Log ‘msg % args’ with severity ‘REPORT’.
+Log ‘msg % args’ with severity ‘STAT’.
+Get a list of all logging.StreamHandler
handlers that log to stdout
Set fully qualified path name to function including class name to the given record.
+Optionally, provide a max width
to attempt to truncate the path name to
+by taking only the first letter of each part of the path until the length is equal to width
.
Print an aligned line with the given text in the centre of the terminal
+Pretty print the Syncify logo in the centre of the terminal
+Print the time in minutes and seconds in the centre of the terminal
+