Skip to main content

No project description provided

Project description

Subtitle Translator

This Python package provides functionality to translate subtitle files from one language to another using the pysrt and translate modules. It includes functions to handle the translation of subtitle texts and save the results to a new file.

Installation

You can install the package using pip. To install the latest version, use:

pip install subtitle-translator

Requirements

Python 3.x pysrt translate

Usage

Import the Package

First, import the subtrans function from the subtitle_translator package:

from subtitle_translator import subtrans

Translate Subtitles

Call the subtrans function to translate a subtitle file. Provide the necessary parameters:

subtrans(file_name, from_lang, to_lang, output_name)

Parameters:

file_name (str): Path to the input subtitle file (e.g., input.srt). from_lang (str): Language code of the original subtitles (e.g., en for English). to_lang (str): Language code of the target language (e.g., es for Spanish). output_name (str): Path where the translated subtitle file will be saved (e.g., output.srt).

Example

Here’s an example of how to use the subtrans function:

	from subtitle_translator import subtrans

	# Translate subtitles from English to Spanish
	subtrans('input.srt', 'en', 'es', 'output.srt')

In this example, the subtitles in input.srt are translated from English to Spanish and saved as output.srt.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you have suggestions, bug reports, or improvements, please open an issue or submit a pull request.

Contact

WhatsApp - https://whatsapp.com/channel/interniq LinkedIn - https://www.linkedin.com/interniq Telegram - https://telegram.me/interniq

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

subtranslate-0.2.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subtranslate-0.2-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file subtranslate-0.2.tar.gz.

File metadata

  • Download URL: subtranslate-0.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.7

File hashes

Hashes for subtranslate-0.2.tar.gz
Algorithm Hash digest
SHA256 6b07604bc0cf7cbaf5e72c9ddce7fe19eb2eb12dd3b6e33dbc54a970eb1d5789
MD5 154a85c5a0999b2fa8acac7f7f818723
BLAKE2b-256 b1cbff59f46f28cac45ca6324e5c2d3ae63c40727b603aafd9b12b3f745cbb5b

See more details on using hashes here.

File details

Details for the file subtranslate-0.2-py3-none-any.whl.

File metadata

  • Download URL: subtranslate-0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.7

File hashes

Hashes for subtranslate-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccc5b290583b7ef4f2c22f3c1a408202d1629092542a05a8703ffd0489672d94
MD5 6a7e5cada62589dc8e0533eb3eca54c8
BLAKE2b-256 c963188ca39b7d2d987bf488252654a14206cee627b20e36a31de14aaf868c73

See more details on using hashes here.

Supported by

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