pysublib — Manipulate subtitle files easily

PySubLib implements routines providing support for reading (parsing) and writing subtitle files of various formats. In particular, it implements the read() function to easily read and parse single subtitle file.

High-level interface

pysublib.detect_format()
See pysublib.core.detect_format().
pysublib.read()
See pysublib.core.read().
pysublib.write()
See pysublob.core.write().

Public Module objects

class pysublib.Calc
See pysublib.calc.Calc.
class pysublib.Subtitle
See pysublib.core.Subtitle.
class pysublib.SubtitleFile
See pysublib.file.SubtitleFile.
class pysublib.MicroDVDFile
See pysublib.formats.microdvd.MicroDVDFile.
class pysublib.MPlayer2File
See pysublib.formats.mpl2.MPlayer2File.
class pysublib.SubRipFile
See pysublib.formats.subrip.SubRipFile.

Module attributes

pysublib.FPS

A dictionary of known subtitle framerates. One of these should be used when setting the fps attribute of any class from pysublib module, mainly the pysublib.core.Subtitle.fps attribute; for example:

>>> import pysublib
>>> sub = pysublib.Subtitle()
>>> sub.fps = pysublib.FPS[30]
pysublib.MODES

A dictionary of known subtitle modes. PySubLib currently supports two modes – time and frame. One of these values should be used when setting the mode attribute of any class from pysublib module, mainly the pysublib.core.Subtitle.mode attribute; for example:

>>> import pysublib
>>> sub = pysublib.Subtitle()
>>> sub.mode = pysublib.MODES["time"]
pysublib.FORMATS

A dictionary of supported subtitle file formats. The keys represent their well known string representation, e.g. “SubRip” and values represent the class implementing the appropriate methods providing support for their reading/parsing and writing.

See also

Supported formats.

Table Of Contents

Previous topic

Introduction

Next topic

pysublib.calc — Convert times and frames values

This Page