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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file argos_translate_files_main-1.4.2.tar.gz.
File metadata
- Download URL: argos_translate_files_main-1.4.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
291ce859397ca4eb516066ecb86f9b697b219eefef999e0ecad2157395430e52
|
|
| MD5 |
927341f761f6b72973df35c12b22b045
|
|
| BLAKE2b-256 |
863259b3c7b2a7a8b7b51f7084979fdc56a318b2a13634ad0108625e5eebab5b
|
File details
Details for the file argos_translate_files_main-1.4.2-py3-none-any.whl.
File metadata
- Download URL: argos_translate_files_main-1.4.2-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d9c1440eeea2f9969963b896424cecc78214a86e994c8904c2ffc0ff634d77
|
|
| MD5 |
e42d25aa5940134d8aad63f8e75ddc01
|
|
| BLAKE2b-256 |
5a88155b82b62056b20ef792d8659c5c7d55d819c609307272adbddf164b7636
|