arioso.platforms.sunoapi.task_store#
Local task store for Suno API requests.
Provides a collections.abc.Mapping interface over locally-persisted task
records, so you can list, filter, and retrieve past Suno generation requests
without depending on a (non-existent) “list all” API endpoint.
Each task is stored as a JSON file keyed by taskId. The store records
request parameters, status, timestamps, and the full API response.
Typical usage:
from arioso.platforms.sunoapi.task_store import SunoTasks
tasks = SunoTasks() # uses default data dir
tasks['5c79...be8e'] # get one task record
list(tasks) # all task IDs
len(tasks) # how many tasks
# Filtered views (return new Mapping objects):
tasks.last(20) # last 20 by creation time
tasks.since(hours=24) # created in last 24 hours
tasks.status('SUCCESS') # only successful tasks
tasks.status('PENDING') # only pending tasks
tasks.failed() # all failed tasks
Classes
|
A |
- class arioso.platforms.sunoapi.task_store.SunoTasks(root_dir=None)[source]#
Bases:
MappingA
Mapping[str, dict]of Suno task records persisted as JSON files.Keys are task IDs, values are task-record dicts with fields:
task_id, operation, status, created_at, updated_at, request_params, response
The store is backed by individual
.jsonfiles in root_dir.- last(n=20)[source]#
Return a view of the most recent n tasks (newest first).
- Return type:
_FilteredTaskView
- pending()[source]#
Return all tasks that are still pending or in progress.
- Return type:
_FilteredTaskView
- since(*, hours=0, minutes=0)[source]#
Return tasks created within the last hours + minutes.
- Return type:
_FilteredTaskView