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

Uploaded Source

Built Distribution

argos_translate_files-1.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for argos-translate-files-1.2.0.tar.gz
Algorithm Hash digest
SHA256 bc8c19da376b057b73ea01be65f82aaba1d57ddce641fee72ea083690653e23b
MD5 72ad8bb5960a522be333dc4fda6dec7a
BLAKE2b-256 3544bf43271c39a4cf11354cef2e53d4d978237601ec3d9506f4fcf5c501023a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argos_translate_files-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcd504aa727866f414490ec137c98495a1e339ee945a5edb9797dabd8ff364a8
MD5 3709400cb71fc8882d66e72677947fd6
BLAKE2b-256 53849e99872ff9bfc149eb936f27d1d29d9dc562ae24cc0039dd8f66d3fa5729

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