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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: argos-translate-files-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 274adaf82aa98cfae374d6ede3f758432717b71965d686dfa5dcf0d6d3822050
MD5 ae413b5aef3627abc7dcde4f7adabc58
BLAKE2b-256 829d3ab2baf07317b2a66f490e45874dde7dd333ace2ccb7d118b739f53a8a43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argos_translate_files-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b8f585471f8a0d083decf55746aa27dfb1a68132dc7fe6407ef7daa2e510e5a
MD5 7bfc0e619218d913512b3a5eed52f550
BLAKE2b-256 7a6c4524c7ae2ed264354be9fb62d7f4334651cd9f091a7df5a05713c184d7c0

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