lrctoolbox packageο
Submodulesο
- lrctoolbox.exceptions module
- lrctoolbox.lrc_metadata module
- lrctoolbox.synced_lyric_line module
- lrctoolbox.synced_lyrics module
SyncedLyricsSyncedLyrics.SUPPORTED_FILE_TYPESSyncedLyrics.copy()SyncedLyrics.has_timestamps_all_equalSyncedLyrics.has_timestamps_in_ascending_orderSyncedLyrics.is_missing_any_timestampSyncedLyrics.is_syncedSyncedLyrics.load()SyncedLyrics.load_from_file()SyncedLyrics.load_from_lines()SyncedLyrics.lyricsSyncedLyrics.parse_str()SyncedLyrics.save_to_file()SyncedLyrics.synced_linesSyncedLyrics.update_metadata()
parse_timestamps()
Module contentsο
lrctoolbox - A Python library for working with LRC files.
- class lrctoolbox.SyncedLyrics[source]ο
Bases:
LRCMetadataA class that represents synced lyrics.
- SUPPORTED_FILE_TYPES: ClassVar[list[str]] = ['.lrc', '.txt']ο
- copy() SyncedLyrics[source]ο
returns a copy of the synced lyrics
- property has_timestamps_all_equal: boolο
checks if the timestamp is all same
- property has_timestamps_in_ascending_order: boolο
checks if the timestamp is in ascending order
- property is_missing_any_timestamp: boolο
Check if any timestamp is None
- property is_synced: boolο
checks if the lyrics is valid and synced Checks Performed:
lyrics is not empty
timestamp is in ascending order
timestamp is not all same
- classmethod load_from_file(path: Path | str)[source]ο
convenience method to load from a file
path: Path to the lrc file
calls load_from_lines internally after reading the file
- classmethod load_from_lines(lines: list[str]) SyncedLyrics[source]ο
Load synced lyrics from a list of strings.
- property lyrics: list[str]ο
lyrics as a list of strings with timestamp if present
- classmethod parse_str(line: str) SyncedLyricLine | dict[str, str] | list[SyncedLyricLine][source]ο
Parse a line for lyrics or lrc metadata
- save_to_file(path: Path | str, overwrite: bool = False, write_metadata: bool = True, additional_metadata: BaseLRCMetadata | None = None)[source]ο
save the synced lyrics to a file
- property synced_lines: list[SyncedLyricLine]ο
returns the lines as a list of SyncedLyricLine objects
- update_metadata(metadata: dict[str, str]) SyncedLyrics[source]ο
updates the metadata of the synced lyrics