Skip to main content

Async SRT subtitle translator using OpenAI

Project description

SRT Translator

A tool that translates SRT subtitle files to Brazilian Portuguese using OpenAI's API. It processes subtitles asynchronously in batches for efficient translation while preserving timing and formatting.

CLI

subconv input.srt output.srt

Options

Option Description Default
-m, --model OpenAI model gpt-4o-mini
-c, --concurrent Max concurrent requests 5
-b, --batch-size Subtitles per batch 15

Library

import asyncio
from pathlib import Path
from subconv import TranslationConfig, TranslationService

config = TranslationConfig(
    input_path=Path("input.srt"),
    output_path=Path("output.srt"),
)

asyncio.run(TranslationService(config).run())

Environment

export OPENAI_API_KEY=your-key

License

MIT


Tests and documentation generated by Claude xD

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

subconv-1.0.0.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

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

subconv-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file subconv-1.0.0.tar.gz.

File metadata

  • Download URL: subconv-1.0.0.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for subconv-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cbe638f9a444b77248932a77d8d87dc7d6e41485677c69d70a0d535f24f755f0
MD5 10a74e43b1600d53a5571bc2614149ab
BLAKE2b-256 0310d65b2bb695d01ac5e4e3e29401c80c3c3a898743efafc3e0c21770a052d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for subconv-1.0.0.tar.gz:

Publisher: publish.yml on vnniciusg/subconv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subconv-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: subconv-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for subconv-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b7697a48f7aa9fde9fd63ad63f5398a7171149e86ab6fc511aa4e2053d33c19
MD5 108c418cc664e545f9d980f60b09856a
BLAKE2b-256 5b8b451260b8b6271a104cda5882fdc579bfd34c85893cf6b7843c9646185bd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for subconv-1.0.0-py3-none-any.whl:

Publisher: publish.yml on vnniciusg/subconv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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