Convert ASS subtitle to SRT format
Project description
pyasstosrt
pyasstosrt – this tool will help you convert Advanced SubStation Alpha (ASS/SSA) subtitle files to SubRip (SRT) files.
Support for str path:
from pyasstosrt import Subtitle
sub = Subtitle('sub.ass')
sub.export()
Support for all Path-like objects, instead of only pathlib's Path:
from pathlib import Path
from pyasstosrt import Subtitle
path = Path('sub.ass')
sub = Subtitle(path)
sub.export()
You can get a sheet with dialogue by specifying output_dialogues.
from pathlib import Path
from pyasstosrt import Subtitle
path = Path('sub.ass')
sub = Subtitle(path)
sub.export(output_dialogues=True)
If you want to remove effects from text, you can use the removing_effects.
from pyasstosrt import Subtitle
sub = Subtitle('sub.ass', removing_effects=True)
sub.export()
You can enable the deletion of duplicate lines with the rearrangement of start and end times.
from pyasstosrt import Subtitle
sub = Subtitle('sub.ass', remove_duplicates=True)
sub.export()
CLI
pyasstosrt --filepath=/Users/user/sub/sub.ass export
Optional You can specify an export folder.
pyasstosrt --filepath=/Users/user/sub/sub.ass export /Users/user/sub/srt
Optional If you want to remove effects from text, you can use the --removing_effects flag.
pyasstosrt --filepath=/Users/user/sub/sub.ass --removing_effects=True export /Users/user/sub/srt
Installation
Most users will want to simply install the latest version, hosted on PyPI:
$ pip install 'pyasstosrt[cli]'
If you just want to use it as a library and don't need the CLI, you can omit the [cli]
extra.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyasstosrt-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77ee51872eab846492586a6d0876e8a4e76d4fe1c97acb7a4fcf158bb88914d2 |
|
MD5 | 95a92ccd0084935a5727d15530741293 |
|
BLAKE2b-256 | 8490bb6e4e8155f3da30fa3a953afccd1194628c4072b651e89d2040b7aaeeda |