Remote Dataset Classes

Here are the classes for remote datasets.

class muspy.RemoteFolderDataset(root: Union[str, pathlib.Path], download_and_extract: bool = False, cleanup: bool = False, convert: bool = False, kind: str = 'json', n_jobs: int = 1, ignore_exceptions: bool = True, use_converted: Optional[bool] = None)[source]

A class of remote datasets containing files in a folder.

This class extended muspy.RemoteDataset and muspy.FolderDataset. Please refer to their documentation for details.

root

Root directory of the dataset.

Type:str or Path
Parameters:
  • download_and_extract (bool, optional) – Whether to download and extract the dataset. Defaults to False.
  • cleanup (bool, optional) – Whether to remove the original archive(s). Defaults to False.
  • convert (bool, optional) – Whether to convert the dataset to MusPy JSON/YAML files. If False, will check if converted data exists. If so, disable on-the-fly mode. If not, enable on-the-fly mode and warns. Defaults to False.
  • kind ({'json', 'yaml'}, optional) – File format to save the data. Defaults to ‘json’.
  • n_jobs (int, optional) – Maximum number of concurrently running jobs in multiprocessing. If equal to 1, disable multiprocessing. Defaults to 1.
  • ignore_exceptions (bool, optional) – Whether to ignore errors and skip failed conversions. This can be helpful if some of the source files is known to be corrupted. Defaults to True.
  • use_converted (bool, optional) – Force to disable on-the-fly mode and use stored converted data

See also

muspy.RemoteDataset
Base class for remote MusPy datasets.
muspy.FolderDataset
A class of datasets containing files in a folder.
read(filename: str) → muspy.music.Music[source]

Read a file into a Music object.

class muspy.RemoteMusicDataset(root: Union[str, pathlib.Path], download_and_extract: bool = False, cleanup: bool = False, kind: str = 'json')[source]

A dataset containing MusPy JSON/YAML files in a folder.

This class extended muspy.RemoteDataset and muspy.FolderDataset. Please refer to their documentation for details.

root

Root directory of the dataset.

Type:str or Path
kind

File format of the data. Defaults to ‘json’.

Type:{‘json’, ‘yaml’}, optional
Parameters:
  • download_and_extract (bool, optional) – Whether to download and extract the dataset. Defaults to False.
  • cleanup (bool, optional) – Whether to remove the original archive(s). Defaults to False.
class muspy.RemoteABCFolderDataset(root: Union[str, pathlib.Path], download_and_extract: bool = False, cleanup: bool = False, convert: bool = False, kind: str = 'json', n_jobs: int = 1, ignore_exceptions: bool = True, use_converted: Optional[bool] = None)[source]

A class of remote datasets containing ABC files in a folder.