Comments (12)
$ argos-translate-cli --from-lang en --to-lang es "Hello World"
Hola Mundo
$ echo "Text to translate" | argos-translate-cli --from-lang en --to-lang es
Texto para traducir
from argos-translate.
@v217 thanks for the input, I'll push a new version with the current code. There's currently a lot of incoming traffic from Hacker News (Github stars have almost doubled in the last 6 hours) so I'm going to wait a day or so to avoid the risk of accidentally pushing a breaking change.
from argos-translate.
A cli UI would also make a pipx installation meaningful - the easiest, most user friendly way to manage python packages.
from argos-translate.
@PJ-Finlay Great Thanks!
from argos-translate.
We're live! I realized Snapcraft was a little more involved so I'm waiting on it for now but live on PyPI.
from argos-translate.
Works great with pipx! Thanks!
from argos-translate.
It would be really good to add input from a file BTW as proposed by OP:
argos-translate-cli -file Novel.txt -from en -to de
Pasting long text on the CLI is too error prone as mentioned at: https://askubuntu.com/questions/380847/is-it-possible-to-translate-words-via-terminal/1309774#1309774
from argos-translate.
Thanks for the issue, this is something I've been meaning to add for a while and I just pushed a basic cli.
Usage:
$ argos-translate-cli --from-lang en --to-lang es "Hello World"
Hola Mundo
I'm going to wait a bit before before pushing this to PyPI or the Snap Store so for now if you want to use it you'll need to install from source. Before pushing there should also be the ability to read text from standard input and install packages.
Any feedback on the API before it's too set in stone is also appreciated.
from argos-translate.
@v217 I agree the plan is to push this to PyPI. I already added the CLI executable as a script in setup.py so pushing to PyPI wouldn't require a code change. I've just been waiting until the CLI was more complete and stable but if someone needs the CLI from PyPI I could push it sooner. You can also install the bleeding edge version from the Github repo with pip in one line:
pip3 install git+https://github.com/argosopentech/argos-translate
Maybe the documentation should be updates to show this instead of the more verbose example that is currently there. However, if someones new to the command line has the one command version fail they may have an easier time debugging the existing version.
from argos-translate.
@PJ-Finlay Great! For me only the funcionality in the example would be very useful and I don't mind if the cli interface changes. I think, people who use argos-translate in their scripts use the library, and for interactive use cli interface changes don't matter.
from argos-translate.
Hello everyone when i try o run the command
$argos-translate-cli --from-lang en --to-lang es "Hello World"
I receive an error
Traceback (most recent call last):
File "/home/aimscs/.local/bin/argos-translate-cli", line 5, in
cli.main()
File "/home/aimscs/.local/lib/python3.6/site-packages/argostranslate/cli.py", line 38, in main
from_lang = installed_languages[from_lang_index]
TypeError: list indices must be integers or slices, not NoneType
how to resolve this
from argos-translate.
Do you have the English and Spanish models installed? We should probably add a more helpful error message for when this happens.
from argos-translate.
Related Issues (20)
- "Download failed" Error
- ssl.SSLError: [SSL: TLSV1_UNRECOGNIZED_NAME] tlsv1 unrecognized name (_ssl.c:1091) HOT 5
- punctuation breaks translation quality
- ArgosTransate for python doesn't translate anything from English to French HOT 1
- Argos_translate no longer works offline? HOT 2
- multilingual-rag using argos-translate HOT 1
- The difficulty of generating a proper LLM for translation from web scraping...
- Feature Request: Allow installing without `nvidia-cuda` packages. HOT 3
- Pipe mode, line-by-line (stdin/stdout)
- Support for tamil language
- no pip install
- Does not support Python 3.12 HOT 1
- How to switch usage to GPU instead of CPU? HOT 1
- BUG: pip install argostranslate does not work on Python 3.12 HOT 3
- Problem in Greek Translation
- How to use custom model?
- Stanza version >=1.1.1 breaks a few langauges HOT 2
- Support for Brazilian Portuguese
- [BUG] SIGSEGV
- Title
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argos-translate.