Skip to main content

Sublib

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.

Features

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

Installation

Download the latest version from PyPi

python -m pip install sublib

More

Testing

Perform the tests with pytest and pytest-mock

python -m pytest tests

More

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("subtitle.srt", "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()
another_subtitle.set_from_general_format(general)

# Print subtitle lines
print(another_subtitle.content)

More

Advanced usage

Please, take a look if you need more details

Contributing

Pull requests are welcome!

Metadata

Release files for sublib 1.2.1

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

Source distribution (sdist)

Source distribution for sublib 1.2.1
File Size Uploaded
sublib-1.2.1.tar.gz 18.6 kB Details

Built distribution (wheel)

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

Total release size: 36.3 kB

Release files / sublib-1.2.1.tar.gz

Download URL sublib-1.2.1.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4a041287d77087685272b88b4cbc01435b67d08f0088a0f757688a6fad4b8864
BLAKE2b-256 checksum
How to use checksums
645967e0e54d8d606b4c58766aba6d49bcde2a809a5a155f62b930d80f765b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

Release files / sublib-1.2.1-py3-none-any.whl

Download URL sublib-1.2.1-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6eb38bea3ab2aa47de3719d9fdcb5ce09df4f34145199dcf160fb44cbe555e7f
BLAKE2b-256 checksum
How to use checksums
37686f3befb492e46625eef9d7c8c0416b17a62fcc4c154cbf90a443fd11074d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.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