pysublib.formats — Objects representing individual subtitle files

Module provides support for reading/parsing and writing of all the supported subtitle file formats. It is divided in separate modules, each for single subtitle format; see below.

See also

Supported formats as well as the implementation of the pysublib.file.SubtitleFile class.

class pysublib.formats.MicroDVDFile
See pysublib.formats.microdvd.MicroDVDFile.
class pysublib.formats.MPlayer2File
See pysublib.formats.mpl2.MPlayer2File.
class pysublib.formats.SubRipFile
See pysublib.formats.subrip.SubRipFile.

MicroDVD

class pysublib.formats.microdvd.MicroDVDFile([path[, encoding[, fps[, newline[, lines]]]]])

Class providing support for reading/parsing and writing of subtitle files in MicroDVD format. Its attributes are described in the pysublib.file.SubtitleFile class, from witch it inherits them.

fps
Subtitles’s framerate.
read()
Return type:pysublib.core.Document

Method which reads and parses individual subtitles from the subtitle file located at the path on the file system.

write(doc)
Parameter:doc (pysublib.core.Document) – data to be written

The subtitles contained in the doc parameter will be written to the file located at the path in the MicroDVD format.

MPlayer2

class pysublib.formats.mpl2.MPlayer2File([path[, encoding[, newline[, lines]]]])

Class providing support for reading/parsing and writing of subtitle files in MPlayer2 format. Its attributes are described in the pysublib.file.SubtitleFile class, from witch it inherits them.

read()
Return type:pysublib.core.Document

Method which reads and parses individual subtitles from the subtitle file located at the path on the file system.

write(doc)
Parameter:doc (pysublib.core.Document) – data to be written

The subtitles contained in the doc parameter will be written to the file located at the path in the MPlayer2 format.

SubRip

class pysublib.formats.subrip.SubRipFile([path[, encoding[, newline[, lines]]]])

Class providing support for reading/parsing and writing of subtitle files in SubRip format. Its attributes are described in the pysublib.file.SubtitleFile class, from witch it inherits them.

read()
Return type:pysublib.core.Document

Method which reads and parses individual subtitles from the subtitle file located at the path on the file system.

write(doc)
Parameter:doc (pysublib.core.Document) – data to be written

The subtitles contained in the doc parameter will be written to the file located at the path in the SubRip format.

Table Of Contents

Previous topic

pysublib.file — Base for the individual subtitle files

Next topic

Examples

This Page