Utils

Utilities for operations on LocalTrack types.

Generally, this will contain global variables representing all supported audio file types and a utility function for loading the appropriate LocalTrack type for a path based on its extension.

Functions:

load_track(path[, remote_wrangler])

Attempt to load a file from a given path, returning the appropriate LocalTrack object

musify.libraries.local.track.utils.load_track(path, remote_wrangler=None)

Attempt to load a file from a given path, returning the appropriate LocalTrack object

Parameters:
  • path (str) – The path of the file to load.

  • remote_wrangler (RemoteDataWrangler (default: None)) – Optionally, provide a RemoteDataWrangler object for processing URIs. This object will be used to check for and validate a URI tag on the file. The tag that is used for reading and writing is set by the uri_tag class attribute on the track object. If no remote_wrangler is given, no URI processing will occur.

Returns:

LocalTrack – Loaded LocalTrack object

Raises:

InvalidFileType – If the file type is not supported.