Python library for easier management and processing of subtitle files.
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
python -m pip install sublib
Perform the tests with
python -m pytest tests
First of all, import the
Each of the supported formats of subtitles is represent by its
# Create a subtitle instance subtitle = sublib.SubRip("subtitle.srt", "utf-8")
All subtitles classes have a few
# Get object content in a universal format general = subtitle.get_general_format() # Set a new object from this format another_subtitle = sublib.MicroDVD() another_subtitle.set_from_general_format(general) # Print subtitle lines print(another_subtitle.content)
Please, take a look if you need more details
Pull requests are welcome!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
sublib-1.2.1.tar.gz (18.6 kB view hashes)
sublib-1.2.1-py3-none-any.whl (17.7 kB view hashes)