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
File details
Details for the file pyasstosrt-1.4.1.tar.gz
.
File metadata
- Download URL: pyasstosrt-1.4.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3dea611acf291f3525b0237b3ae4e4548c08d79d6bfa002855ca3e7aa2e8da4 |
|
MD5 | 32fb827fd5b5c6cdffcdd5de977aed93 |
|
BLAKE2b-256 | b9321bb2913220571be926adb857fb563431ff6bceeee7a7dde100e86ce33f14 |
File details
Details for the file pyasstosrt-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: pyasstosrt-1.4.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1394544ceef60e4f16a2e4eab9710417763ac955ae7450d07e36fe57d4e5cb62 |
|
MD5 | b135530411e1ab40da0b66acd869652c |
|
BLAKE2b-256 | dad78b8ffce5deb12e63d6a1d002a1b6d8ba29d18635186e6fc453f1c91780a6 |