pysubs2
pysubs2 is a Python library for editing subtitle files. It’s based on SubStation Alpha, the native format of Aegisub; it also supports SubRip and MicroDVD formats. There is a small CLI tool for batch conversion and retiming.
pysubs2 is licensed under the MIT license (see LICENSE.txt).
To learn more, please see the documentation.