Skip to main content

A small package and CLI for manipulating subtitles

Project description

Pyzub: Manipulate subtitles

Pyzub is a small package and CLI for manipulating subtitles

Suported Formats:

  • SubRip [.srt].

** Plans to Support:**

  • SubStation Alpha [.ssa]
  • SubViewer [.sub]
  • Universal Subtitle Format [.usf]


Run pip install pyzub

Command Line Interface:

At the moment only the slide command is available (arguably the most important feature). The slide command of pyzub lets you move your subtitles so you can synchronize your subtitles manually.

$ pyzub slide -h
Usage: pyzub slide [OPTIONS] FILEPATH

  --hours INTEGER
  --minutes INTEGER
  --seconds INTEGER
  --milliseconds INTEGER
  --overwrite             Modifies the subtitle file in place.
  --verbose               Displays a progress bar and a message when finished.
  --help, -h              Show this message and exit.


This will move your subtitles by 2.5 seconds (you can also give negative values).

$ pyzub slide --seconds 2 --milliseconds 500

By default it will generate an output file named, unless --overwrite is used. The output file will always be in utf-8 encoding and use your system new line character.


You can read a subtitle file:

from pyzub.subfiles import SRTFile

filepath = '/home/user/'
subfile = SRTFile(filepath)

Iterate over the file:

for subtitle in subfile:

Print a SRTFile:

Path: /home/user/
Codec: ISO-8859-1
Subtitles: 451

Get a subtitle:

# idx could be a number from 1 to 451 in this case
subtitle = subfile.get_subtitle(idx)

Print the subtitle:

Index: 1
Start Time: 00:00:04,605
End Time: 00:00:06,105
Text: En un día cualquiera,

An of course modify anything you want directly:

subtile.text = 'modified subtitle'
subtitle.start_time = timedelta(minutes=10)

# write the changes to disk

Planed features:

  • Automatic grammar and syntax correction
  • Automatic synchronization from audio
  • Automatic subtitle file downloads



Project details

Download files

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

Files for pyzub, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size pyzub-0.1.5-py3-none-any.whl (5.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyzub-0.1.5.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page