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, .pdf

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.1.tar.gz (19.6 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.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for argos_translate_files_main-1.4.1.tar.gz
Algorithm Hash digest
SHA256 fd389ad18fc793a638c57b82ae508cb65eee4c529573e115bbf7a3f890d8b4b2
MD5 655eaea178665f712d133ac06d40b2e2
BLAKE2b-256 a898026e7b60487413f5967aba67cc0951a7541954f72f191c317db1c8763f55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for argos_translate_files_main-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9424c86ffe586a92df59036c4180b4015a28bf2fd7a893160af6a6a60fdae5b3
MD5 7749be901dd95c85230981597a3c51f3
BLAKE2b-256 23449505bc8ccdd2243c8ccc5fd33dbe298f457a0af50232b7009b2b8a93f31b

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