Skip to main content

Translate files with Argos Translate

Project description

Argos Translate Files

Translate files using Argos Translate.

Supported file format

.txt, .odt, .odp, .docx, .pptx, .epub, .html, .srt

Install

pip install argos-translate-files

Example

import os.path

import argostranslate.package, argostranslate.translate


import argostranslatefiles
from argostranslatefiles import argostranslatefiles

from_code = "fr"
to_code = "en"

installed_languages = argostranslate.translate.get_installed_languages()
from_lang = list(filter(
    lambda x: x.code == from_code,
    installed_languages))[0]
to_lang = list(filter(
    lambda x: x.code == to_code,
    installed_languages))[0]
underlying_translation = from_lang.get_translation(to_lang)

argostranslatefiles.translate_file(underlying_translation, os.path.abspath('path/to/file.txt'))

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

argos-translate-files-1.3.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

argos_translate_files-1.3.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file argos-translate-files-1.3.0.tar.gz.

File metadata

  • Download URL: argos-translate-files-1.3.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for argos-translate-files-1.3.0.tar.gz
Algorithm Hash digest
SHA256 85f9a2db0af43667656fdceca17e386413b338e4dcf7f4a43ffdc8936e392bc4
MD5 54cdf4b0f7fa0dbd2e8fb8a118d4d640
BLAKE2b-256 e2aa2ab39115681c1779a802cf949490bb0945b99bdf56eea17c2f715c60d9b6

See more details on using hashes here.

File details

Details for the file argos_translate_files-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for argos_translate_files-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7d196bca780f41ef6b2997f76dd3b5d5153c2eddcae89f6b12fb806b1d9dbfd
MD5 14ad7ade8cfe1b219b72562d0ad9e8e0
BLAKE2b-256 ad56905df18544190231ad0dad739ba310246cfacc751ce46986b970bb3163ed

See more details on using hashes here.

Supported by

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