Skip to main content

A python subtitle toolkit.

Project description

Installation:

pip install pyautosub

Examples:

from pyautosub import SubtitleFile

filename = r'C:\test\bos.srt'
s = SubtitleFile()
s.open_subtitle_file(filename)
s.print_list()

filename = r'C:\codetest\1.srt'
x = SubtitleFile()
x.open_subtitle_file(filename)
x.resync(-5.701)
x.save_as(r'C:\codetest\1 (1).srt')

filename = r'C:\codetest\2.srt'
x = SubtitleFile()
x.open_subtitle_file(filename)
x2y = [(9.919, 10.919),
       (1611.756, 1614.256), #00:26:51,756 --> (+2.5)
       (2335.828, 2339.828)] #00:38:55,828 --> (+4)
x.linear_transformation(x2y, True, True)
x.save_as(r'C:\codetest\2 (1).srt')

Supported Types:

  • Read: SubRip(.srt), MicroDVD(.sub)
  • Write: SubRip(.srt)

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pyautosub-0.97.2-alpha.tar.gz (8.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page