Skip to main content

srtedit

A command-line tool for quickly editing subtitle (.srt) files.

Installation

pip install srtedit

Basic Usage

Offset subtitles in milliseconds

srtedit subtitles.srt --offset 1000

Will add exactly 1 second to all subtitle elements. Conversely:

srtedit subtitles.srt --offset -1000

Will subtract 1 second from all subtitle elements.

The modified subtitles will be printed to stdout. Use -o to specify an output file:

srtedit subtitles.srt --offset 500 -o new.srt

Selecting

The -s/--select option allows you to select a single or range of subtitle elements to modify. This can work alongside other options such as --remove, --edit, and --offset.

On its own, it can be used to select a portion of the subtitles:

srtedit subtitles.srt -s 1:10   # Grab the first 10 elements 

Single element:

srtedit subtitles.srt -s 4  # Grab the 4th element

Remove subtitle element

Use the -r/--remove option to remove a selected element.

srtedit subtitles.srt -s 1 --remove

Edit subtitle element

srtedit subtitles.srt -s 1 --edit "New text"

Count number of elements

srtedit subtitles.srt --count

Multiple options

You can use multiple options together like this:

srtedit subtitles.srt -s 1 --edit "New text" --offset 1000 --view -o modified.srt

Will set the text of the first element to "New text" then add 1 second to the start and end times and then display the new values to the terminal and then finally write it to modified.srt

Release files for srtedit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for srtedit 0.2.0
File Size Uploaded
srtedit-0.2.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for srtedit 0.2.0
File Interpreter ABI Platform
srtedit-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / srtedit-0.2.0.tar.gz

Download URL srtedit-0.2.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e85dfa6ed373bea2171104f81f88d7a7191d795fdc2f535f253a3bde24406f43
BLAKE2b-256 checksum
How to use checksums
5892234d87d13c29fdb72bb25f514827f9b812cc07fbd0c99531c5c7e932b8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.13.5 Linux/6.12.41+deb13-amd64

Release files / srtedit-0.2.0-py3-none-any.whl

Download URL srtedit-0.2.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07bed29a1db5831ff9942e0789b41e7fdc34fdaedf8447704b489388e1fcdd49
BLAKE2b-256 checksum
How to use checksums
0273850c02fdc4a351eafe7e6d793aa24b3751d90b4d19fe344e1fa3fcaa920b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.13.5 Linux/6.12.41+deb13-amd64

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page