From 92ea3cd2c11e4aa482c85c38e8d9fccf1e268f14 Mon Sep 17 00:00:00 2001 From: SuHun Han Date: Fri, 10 Mar 2017 23:23:33 +0900 Subject: [PATCH] Update README --- README.rst | 34 ++++++++++++++++++---------------- googletrans/client.py | 6 ++++-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.rst b/README.rst index 9212e2b..3aa1065 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,15 @@ -Py-GoogleTrans -============== +Googletrans +=========== -|GitHub license| |wercker status| |Documentation Status| |PyPI version| +|GitHub license| |travis status| |Documentation Status| |PyPI version| |Coverage Status| |Code Climate| -Py-GoogleTrans is a **free** and **unlimited** python library that +Googletrans is a **free** and **unlimited** python library that implemented Google Translate API. This uses the `Google Translate Ajax API `__ to make calls to such methods as detect and translate. -Compatible with Python 2.7+ and 3.4+ (cPython and PyPy. Py 2.6 and 3.3 +Compatible with Python 2.7+ and 3.4+ (CPython and PyPy. Py 2.6 and 3.3 are not tested yet.) For details refer to the `API @@ -32,7 +32,7 @@ more features are coming soon. - Proxy support - Internal session management (for better bulk translations) -- Customizable service URL (translate.google.***com***) +- Customizable service URL (translate.google.**com**) HTTP/2 support ~~~~~~~~~~~~~~ @@ -80,7 +80,8 @@ source language. .. code:: python - >>> from googletrans import translator + >>> from googletrans import Translator + >>> translator = Translator() >>> translator.translate('안녕하세요.') # >>> translator.translate('안녕하세요.', dest='ja') @@ -112,7 +113,8 @@ a given sentence. .. code:: python - >>> from googletrans import translator + >>> from googletrans import Translator + >>> translator = Translator() >>> translator.detect('이 문장은 한글로 쓰여졌습니다.') # >>> translator.detect('この文章は日本語で書かれました。') @@ -188,7 +190,7 @@ Contributions to this library are always welcome and highly encouraged 1. Fork this project. 2. Create a topic branch. 3. Implement your feature or bug fix. -4. Run ``python tests.py`` or ``python -m unittest -v``. +4. Run ``pytest``. 5. Add a test for yout feature or bug fix. 6. Run step 4 again. If your changes are not 100% covered, go back to step 5. @@ -200,7 +202,7 @@ Contributions to this library are always welcome and highly encouraged License ------- -Py-GoogleTrans is licensed under the MIT License. The terms are as +Googletrans is licensed under the MIT License. The terms are as follows: :: @@ -229,13 +231,13 @@ follows: .. |GitHub license| image:: https://img.shields.io/github/license/mashape/apistatus.svg :target: http://opensource.org/licenses/MIT -.. |wercker status| image:: https://app.wercker.com/status/b888422b2e335c431f9a10bd8b2768cd/s - :target: https://app.wercker.com/project/bykey/b888422b2e335c431f9a10bd8b2768cd +.. |travis status| image:: https://travis-ci.org/ssut/py-googletrans.svg?branch=master + :target: https://travis-ci.org/ssut/py-googletrans .. |Documentation Status| image:: https://readthedocs.org/projects/py-googletrans/badge/?version=latest :target: https://readthedocs.org/projects/py-googletrans/?badge=latest -.. |PyPI version| image:: https://badge.fury.io/py/py-googletrans.svg - :target: http://badge.fury.io/py/py-googletrans -.. |Coverage Status| image:: https://coveralls.io/repos/ssut/py-googletrans/badge.svg - :target: https://coveralls.io/r/ssut/py-googletrans +.. |PyPI version| image:: https://badge.fury.io/py/googletrans.svg + :target: http://badge.fury.io/py/googletrans +.. |Coverage Status| image:: https://coveralls.io/repos/github/ssut/py-googletrans/badge.svg + :target: https://coveralls.io/github/ssut/py-googletrans .. |Code Climate| image:: https://codeclimate.com/github/ssut/py-googletrans/badges/gpa.svg :target: https://codeclimate.com/github/ssut/py-googletrans diff --git a/googletrans/client.py b/googletrans/client.py index 2b2bb4d..addc199 100644 --- a/googletrans/client.py +++ b/googletrans/client.py @@ -61,7 +61,8 @@ class Translator(object): Translate the passed text into destination language. Basic usage: - >>> from googletrans import translator + >>> from googletrans import Translator + >>> translator = Translator() >>> translator.translate('안녕하세요.') >>> translator.translate('안녕하세요.', dest='ja') @@ -135,7 +136,8 @@ class Translator(object): Detect the language of a text. Basic usage: - >>> from googletrans import translator + >>> from googletrans import Translator + >>> translator = Translator() >>> translator.detect('이 문장은 한글로 쓰여졌습니다.') >>> translator.detect('この文章は日本語で書かれました。')