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

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.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

argos_translate_files-1.1.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: argos-translate-files-1.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for argos-translate-files-1.1.3.tar.gz
Algorithm Hash digest
SHA256 c6931ea8fbabdc24903ceaabfe848be0fa4a0477d00451a8dfbc1525b623f0ba
MD5 02893cc7eb9405fca1be4eac45d55089
BLAKE2b-256 d24f75649052874b1c4ad02d8d73af1bba1457e4dde57be0b767bd7a95968db5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argos_translate_files-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d751b492530af59073e32b8a81541b1294bb774f6178d0976123fbe7bb68d70
MD5 7cf96ab195aba8d290654413b74cb84d
BLAKE2b-256 3580a546f4d27da9297ecc0b3c3018d6aa08ebd31111731281ed68225b442f46

See more details on using hashes here.

Supported by

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