Skip to main content

Python library for easier management and processing of subtitle files.

Project description


Release Min. Python version License GPLv3 Code quality Tests

Python library for easier management and processing of subtitle files. Easily manage their content and conveniently use it in your own projects.


  • Read files data
  • Convert subtitles formats
  • Process content separated into lines
  • Search for strings in data
  • Acquire specific lines
  • Detect used format


Download the latest version from PyPi

python -m pip install sublib



Perform the tests with pytest and pytest-mock

python -m pytest tests


Basic usage

First of all, import the package

import sublib

Each of the supported formats of subtitles is represent by its class

# Create a subtitle instance
subtitle = sublib.SubRip("", "utf-8")

All subtitles classes have a few methods and attributes

# Get object content in a universal format
general = subtitle.get_general_format()

# Set a new object from this format
another_subtitle = sublib.MicroDVD()

# Print subtitle lines


Advanced usage

Please, take a look if you need more details


Pull requests are welcome!

Project details

Download files

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

Source Distribution

sublib-1.2.1.tar.gz (18.6 kB view hashes)

Uploaded source

Built Distribution

sublib-1.2.1-py3-none-any.whl (17.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page