add command line application
This commit is contained in:
parent
73599e70c5
commit
17d8802deb
32
README.md
32
README.md
@ -64,6 +64,38 @@ $ pip install py-googletrans
|
|||||||
# <Detected lang=eo confidence=0.10538048>
|
# <Detected lang=eo confidence=0.10538048>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## GoogleTrans as a command line application
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ translate -h
|
||||||
|
usage: translate [-h] [-d DEST] [-s SRC] [-c] text
|
||||||
|
|
||||||
|
Python Google Translator as a command-line tool
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
text The text you want to translate.
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-d DEST, --dest DEST The destination language you want to translate.
|
||||||
|
(Default: en)
|
||||||
|
-s SRC, --src SRC The source language you want to translate. (Default:
|
||||||
|
auto)
|
||||||
|
-c, --detect
|
||||||
|
|
||||||
|
$ translate "veritas lux mea" -s la -d en
|
||||||
|
[veritas] veritas lux mea
|
||||||
|
->
|
||||||
|
[en] The truth is my light
|
||||||
|
[pron.] The truth is my light
|
||||||
|
|
||||||
|
$ translate -c "안녕하세요."
|
||||||
|
[ko, 1] 안녕하세요.
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## A note on library usage
|
## A note on library usage
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"""Free Google Translate API for Python. Translates totally free of charge."""
|
"""Free Google Translate API for Python. Translates totally free of charge."""
|
||||||
|
|
||||||
__version__ = 1.1
|
__version__ = 1.1.1
|
3
setup.py
3
setup.py
@ -6,7 +6,7 @@ def install():
|
|||||||
desc = googletrans.__doc__
|
desc = googletrans.__doc__
|
||||||
setup(
|
setup(
|
||||||
name='py-googletrans',
|
name='py-googletrans',
|
||||||
version='1.1',
|
version='1.1.1',
|
||||||
description=desc,
|
description=desc,
|
||||||
long_description=desc,
|
long_description=desc,
|
||||||
author='SuHun Han',
|
author='SuHun Han',
|
||||||
@ -31,6 +31,7 @@ def install():
|
|||||||
'requests',
|
'requests',
|
||||||
'future',
|
'future',
|
||||||
],
|
],
|
||||||
|
scripts=['translate'],
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user