python3-pysubs2 (Library for editing subtitle files)

pysubs2 is a Python library for editing subtitle files. It’s based
on SubStation Alpha, the native format of Aegisub; it also supports
SubRip (SRT), MicroDVD, MPL2, TMP and WebVTT formats and OpenAI
Whisper captions.
