api/lyric_search/constructors.py

22 lines
557 B
Python
Raw Normal View History

2025-01-13 20:47:39 -05:00
#!/usr/bin/env python3.12
2025-02-15 21:09:33 -05:00
from dataclasses import dataclass
from typing import Union
2025-01-13 20:47:39 -05:00
@dataclass
class LyricsResult:
2025-01-19 07:01:07 -05:00
"""
Class for returned Lyrics Results
Attributes:
artist (str): returned artist
song (str): returned song
src (str): source result was fetched from
2025-02-15 21:09:33 -05:00
lyrics (Union[str, list]): str if plain lyrics, list for lrc
2025-01-19 07:01:07 -05:00
time (float): time taken to retrieve lyrics from source
2025-01-17 07:50:21 -05:00
"""
2025-01-13 20:47:39 -05:00
artist: str
song: str
src: str
2025-02-15 21:09:33 -05:00
lyrics: Union[str, list]
2025-01-17 06:41:56 -05:00
confidence: int
2025-02-14 16:07:24 -05:00
time: float = 0.00