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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for argos-translate-files-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036c8d3e1f97bcbcbcce188b1d692060e81f10f07732a3028b70bdc18c8a86c6 |
|
MD5 | 42a0eb0c48c95029a06d0da043dff07d |
|
BLAKE2b-256 | 83ab55a6b91dc5bbb412c874229b31d85486a03fe2a7487b2c307501107e4ce5 |
Close
Hashes for argos_translate_files-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4a4eb1999067913d61a1304799dc618af50b957a096a9b7350296170269b8ab |
|
MD5 | 0ec87b062b77c7dea1372d7a7bc33a6b |
|
BLAKE2b-256 | e5c61f2f04a390d13c3c03daaaf6494097583e1e34bee9afffdc222f4afb52ec |