add command line application

This commit is contained in:
ssut 2015-06-06 17:52:59 +09:00
parent 73599e70c5
commit 17d8802deb
3 changed files with 35 additions and 2 deletions

View File

@ -64,6 +64,38 @@ $ pip install py-googletrans
# <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

View File

@ -1,3 +1,3 @@
"""Free Google Translate API for Python. Translates totally free of charge."""
__version__ = 1.1
__version__ = 1.1.1

View File

@ -6,7 +6,7 @@ def install():
desc = googletrans.__doc__
setup(
name='py-googletrans',
version='1.1',
version='1.1.1',
description=desc,
long_description=desc,
author='SuHun Han',
@ -31,6 +31,7 @@ def install():
'requests',
'future',
],
scripts=['translate'],
)
if __name__ == "__main__":