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_main-1.4.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

argos_translate_files_main-1.4.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file argos_translate_files_main-1.4.0.tar.gz.

File metadata

File hashes

Hashes for argos_translate_files_main-1.4.0.tar.gz
Algorithm Hash digest
SHA256 49636a3062ee4bf1e240c249024a65ed043050570cd296069326d19b54bc0bac
MD5 3fa26dd662def9ef757339f09407427a
BLAKE2b-256 6ce547624eeb6e1c3984f6e790c967c101beb93ae5ccfc5af0b9875ad171f848

See more details on using hashes here.

File details

Details for the file argos_translate_files_main-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for argos_translate_files_main-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29449736c3e9a70a0a7320dd6e39237a1ff7e37bead73405625ba553133dbfc0
MD5 895a0aba50baaa517d747dd2c3555c4d
BLAKE2b-256 7335a3f3e83eaec3cbd540fe2b79f8c2a5724b677694f1b02445aea983594250

See more details on using hashes here.

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