arioso.tools#
High-level tools for common arioso workflows (submit, poll, download).
Functions
|
Download completed songs to target_folder. |
|
Return a ready-to-use platform adapter. |
|
Parse style from a filename like |
|
Poll until a task completes. |
|
Convert arbitrary text to a filesystem-safe string. |
|
Submit an upload-cover job. |
|
Convert wav to a trimmed mp3. |
- arioso.tools.download_songs(songs, target_folder, *, name_prefix='cover', adapter=None)[source]#
Download completed songs to target_folder. Returns list of saved paths.
- arioso.tools.ensure_adapter(adapter='sunoapi')[source]#
Return a ready-to-use platform adapter.
adaptercan be:An existing adapter instance — returned as-is.
A platform config dict — instantiated via its
Adapterclass.A string that is a valid platform name (e.g.
"sunoapi") — loaded from the arioso registry.None— falls back toDFLT_PLATFORM.
Raises
ValueErrorfor unrecognised inputs.
- arioso.tools.extract_style(filename)[source]#
Parse style from a filename like
barry_{key}_{bpm}bpm_{Style}.wav.
- arioso.tools.poll_status(task_id, *, poll_interval=15, timeout=600, adapter=None)[source]#
Poll until a task completes. Returns list of completed Song objects.
- arioso.tools.submit_cover(source_path, *, style='', prompt='', instrumental=True, model='V5', audio_weight=0.5, style_weight=0.5, source_prep=functools.partial(<function wav_to_mp3>, max_duration=480), adapter='sunoapi')[source]#
Submit an upload-cover job. Returns
(task_id, source_path).- Parameters:
source_path – Path to source audio file.
source_prep – Callable
(path) -> pathto prepare the source file before upload (e.g. convert wav to mp3). Defaults towav_to_mp3()(trimmed to max_duration).adapter – Platform adapter, config dict, platform name, or
None.
The caller is responsible for cleaning up source_path when done.