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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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-1.4.4-py3-none-any.whl.
File metadata
- Download URL: argos_translate_files-1.4.4-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7737f5112a04f3b87fad3eed3f5fb3e862037950e66ae93302c036e5192beb5d
|
|
| MD5 |
e9a4d5f299eef13d6b722a79e36d9541
|
|
| BLAKE2b-256 |
1a9571515647ef4ada5499302adfb1689589ad3437253ccd62ac3b53edce314d
|