YAML Interface

muspy.load_json(path: Union[str, pathlib.Path]) → muspy.music.Music[source]

Load a JSON file into a Music object.

Parameters:path (str or Path) – Path to the file to load.
Returns:Loaded Music object.
Return type:muspy.Music
muspy.save_json(path: Union[str, pathlib.Path], music: Music)[source]

Save a Music object to a JSON file.

Parameters:
  • path (str or Path) – Path to save the JSON file.
  • music (muspy.Music) – Music object to save.

Note

A YAML schema is available for validating a YAML file against MusPy’s format.