{ "info": { "author": "poipoii", "author_email": "earth.sama@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "License :: Freeware", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Education" ], "description": "Googletrans\n===========\n\nFork from `stephwag/py-googletrans `__.\n\n===========\n\n|GitHub license| |travis status| |Documentation Status| |PyPI version| |Python Version|\n|Known Vulnerabilities| |Coverage Status| |Code Climate|\n\nGoogletrans is a **free** and **unlimited** python library that\nimplemented Google Translate API. This uses the `Google Translate Ajax\nAPI `__ to make calls to such methods as\ndetect and translate.\n\nCompatible with Python 2.7+ and 3.4+. (Note: Python 2 support will be dropped in the\nnext major release.)\n\nFor details refer to the `API\nDocumentation `__.\n\nFeatures\n--------\n\n- Fast and reliable - it uses the same servers that\n translate.google.com uses\n- Auto language detection\n- Bulk translations\n- Customizable service URL\n- Connection pooling (the advantage of using requests.Session)\n- HTTP/2 support\n\nTODO\n~~~~\n\nmore features are coming soon.\n\n- Proxy support\n- Internal session management (for better bulk translations)\n\nHTTP/2 support\n~~~~~~~~~~~~~~\n\nThis is a great deal for everyone! (up to 2x times faster in my test) If\nyou want to get googletrans faster you should install\n`hyper `__ package. Googletrans will\nautomatically detect if hyper is installed and if so, it will be used\nfor http networking.\n\nHow does this library work\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou may wonder why this library works properly, whereas other\napproaches such like goslate won't work since Google has updated its\ntranslation service recently with a ticket mechanism to prevent a lot of\ncrawler programs.\n\nI eventually figure out a way to generate a ticket by reverse\nengineering on the `obfuscated and minified code used by Google to\ngenerate such\ntoken `__,\nand implemented on the top of Python. However, this could be blocked at\nany time.\n\n--------------\n\nInstallation\n------------\n\nTo install, either use things like pip with the package \"googletrans\"\nor download the package and put the \"googletrans\" directory into your\npython path. Anyway, it is noteworthy that, this just requires two\nmodules: requests and future.\n\n.. code:: bash\n\n $ pip install ggtrans\n\nBasic Usage\n-----------\n\nIf source language is not given, google translate attempts to detect the\nsource language.\n\n.. code:: python\n\n >>> from googletrans import Translator\n >>> translator = Translator()\n >>> translator.translate('\uc548\ub155\ud558\uc138\uc694.')\n # \n >>> translator.translate('\uc548\ub155\ud558\uc138\uc694.', dest='ja')\n # \n >>> translator.translate('veritas lux mea', src='la')\n # \n\nCustomize service URL\n~~~~~~~~~~~~~~~~~~~~~\n\nYou can use another google translate domain for translation. If multiple\nURLs are provided it then randomly chooses a domain.\n\n.. code:: python\n\n >>> from googletrans import Translator\n >>> translator = Translator(service_urls=[\n 'translate.google.com',\n 'translate.google.co.kr',\n ])\n\nAdvanced Usage (Bulk)\n~~~~~~~~~~~~~~~~~~~~~\n\nArray can be used to translate a batch of strings in a single method\ncall and a single HTTP session. The exact same method shown above work\nfor arrays as well.\n\n.. code:: python\n\n >>> translations = translator.translate(['The quick brown fox', 'jumps over', 'the lazy dog'], dest='ko')\n >>> for translation in translations:\n ... print(translation.origin, ' -> ', translation.text)\n # The quick brown fox -> \ube60\ub978 \uac08\uc0c9 \uc5ec\uc6b0\n # jumps over -> \uc774\uc0c1 \uc810\ud504\n # the lazy dog -> \uac8c\uc73c\ub978 \uac1c\n\nLanguage detection\n~~~~~~~~~~~~~~~~~~\n\nThe detect method, as its name implies, identifies the language used in\na given sentence.\n\n.. code:: python\n\n >>> from googletrans import Translator\n >>> translator = Translator()\n >>> translator.detect('\uc774 \ubb38\uc7a5\uc740 \ud55c\uae00\ub85c \uc4f0\uc5ec\uc84c\uc2b5\ub2c8\ub2e4.')\n # \n >>> translator.detect('\u3053\u306e\u6587\u7ae0\u306f\u65e5\u672c\u8a9e\u3067\u66f8\u304b\u308c\u307e\u3057\u305f\u3002')\n # \n >>> translator.detect('This sentence is written in English.')\n # \n >>> translator.detect('Tiu frazo estas skribita en Esperanto.')\n # \n\nGoogleTrans as a command line application\n-----------------------------------------\n\n.. code:: bash\n\n $ translate -h\n usage: translate [-h] [-d DEST] [-s SRC] [-c] text\n\n Python Google Translator as a command-line tool\n\n positional arguments:\n text The text you want to translate.\n\n optional arguments:\n -h, --help show this help message and exit\n -d DEST, --dest DEST The destination language you want to translate.\n (Default: en)\n -s SRC, --src SRC The source language you want to translate. (Default:\n auto)\n -c, --detect\n\n $ translate \"veritas lux mea\" -s la -d en\n [veritas] veritas lux mea\n ->\n [en] The truth is my light\n [pron.] The truth is my light\n\n $ translate -c \"\uc548\ub155\ud558\uc138\uc694.\"\n [ko, 1] \uc548\ub155\ud558\uc138\uc694.\n\n--------------\n\nNote on library usage\n---------------------\n\nDISCLAIMER: this is an unofficial library using the web API of translate.google.com\nand also is not associated with Google.\n\n- **The maximum character limit on a single text is 15k.**\n\n- Due to limitations of the web version of google translate, this API\n does not guarantee that the library would work properly at all times\n (so please use this library if you don't care about stability).\n\n- **Important:** If you want to use a stable API, I highly recommend you to use\n `Google's official translate\n API `__.\n\n- If you get HTTP 5xx error or errors like #6, it's probably because\n Google has banned your client IP address.\n\n--------------\n\nVersioning\n----------\n\nThis library follows `Semantic Versioning `__ from\nv2.0.0. Any release versioned 0.x.y is subject to backwards incompatible\nchanges at any time.\n\nSubmitting a Pull Request\n-------------------------\n\nContributions to this library are always welcome and highly encouraged\n:)\n\n1. Fork this project.\n2. Create a topic branch.\n3. Implement your feature or bug fix.\n4. Run ``pytest``.\n5. Add a test for yout feature or bug fix.\n6. Run step 4 again. If your changes are not 100% covered, go back to\n step 5.\n7. Commit and push your changes.\n8. Submit a pull request.\n\n--------------\n\nLicense\n-------\n\nGoogletrans is licensed under the MIT License. The terms are as\nfollows:\n\n::\n\n The MIT License (MIT)\n\n Copyright (c) 2015 SuHun Han\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n.. |GitHub license| image:: https://img.shields.io/github/license/mashape/apistatus.svg\n :target: https://opensource.org/licenses/MIT\n.. |travis status| image:: https://travis-ci.com/poipoii/py-googletrans.svg?branch=master\n :target: https://travis-ci.com/poipoii/py-googletrans\n.. |Documentation Status| image:: https://readthedocs.org/projects/ggtrans/badge/?version=latest\n :target: https://readthedocs.org/projects/ggtrans/?badge=latest\n.. |PyPI version| image:: https://badge.fury.io/py/ggtrans.svg\n :target: https://badge.fury.io/py/ggtrans\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/ggtrans\n :target: https://pypi.org/project/ggtrans/\n :alt: PyPI - Python Version\n.. |Coverage Status| image:: https://coveralls.io/repos/github/poipoii/py-googletrans/badge.svg?branch=master\n :target: https://coveralls.io/github/poipoii/py-googletrans?branch=master\n.. |Code Climate| image:: https://api.codeclimate.com/v1/badges/4fdb595d019205845cc2/maintainability\n :target: https://codeclimate.com/github/poipoii/py-googletrans/maintainability\n :alt: Maintainability\n.. |Known Vulnerabilities| image:: https://snyk.io/test/github/poipoii/py-googletrans/badge.svg\n :target: https://snyk.io/test/github/poipoii/py-googletrans\n :alt: Known Vulnerabilities\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/poipoii/py-googletrans", "keywords": "google translate translator", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ggtrans", "package_url": "https://pypi.org/project/ggtrans/", "platform": "", "project_url": "https://pypi.org/project/ggtrans/", "project_urls": { "Homepage": "https://github.com/poipoii/py-googletrans" }, "release_url": "https://pypi.org/project/ggtrans/2.4.1/", "requires_dist": [ "requests", "hyper ; extra == 'h2'" ], "requires_python": ">=2.7", "summary": "Free Google Translate API for Python. Translates totally free of charge.", "version": "2.4.1" }, "last_serial": 5840102, "releases": { "2.4.0": [ { "comment_text": "", "digests": { "md5": "220be36e4cda59e54e9408ce3ea14713", "sha256": "068105cb9ed61e03088b41cc9e1160203af41585ae9366f59aec650017c1cb35" }, "downloads": -1, "filename": "ggtrans-2.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "220be36e4cda59e54e9408ce3ea14713", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16474, "upload_time": "2018-11-29T14:49:10", "url": "https://files.pythonhosted.org/packages/d8/f1/d761115f04d875479c28c30dae8873a11530d1fa89ec32154f2faf897e5a/ggtrans-2.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9667088ecc710af91791670e85810e55", "sha256": "289dc615bc67d53fa2d745f1c85cbdec9dadb9935f503864cb9543fe7478c8d3" }, "downloads": -1, "filename": "ggtrans-2.4.0.tar.gz", "has_sig": false, "md5_digest": "9667088ecc710af91791670e85810e55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17129, "upload_time": "2018-11-29T14:49:13", "url": "https://files.pythonhosted.org/packages/fd/bd/a992dcbbfc6e56df9fbcfc274d8328c100beee7bea7d95c9c42c773365e5/ggtrans-2.4.0.tar.gz" } ], "2.4.1": [ { "comment_text": "", "digests": { "md5": "ed1a034eef4c34d6fdb08b362c2afd5e", "sha256": "92b34b21fd4e922b8342529982e0e1ab6620c8b3ab8029bef3bb11f56e0130cf" }, "downloads": -1, "filename": "ggtrans-2.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ed1a034eef4c34d6fdb08b362c2afd5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7", "size": 16558, "upload_time": "2019-09-17T07:41:06", "url": "https://files.pythonhosted.org/packages/2f/30/3e4f26a83d65e2b2b3114203a7ec35c34663a0eae08939e92600a11134c2/ggtrans-2.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bccf5f7342c64e50af40e86a9c2ef13e", "sha256": "421ca4714792ef89a3377ab49ddf35841f7971764f6d35658db4e74dc7818380" }, "downloads": -1, "filename": "ggtrans-2.4.1.tar.gz", "has_sig": false, "md5_digest": "bccf5f7342c64e50af40e86a9c2ef13e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 17402, "upload_time": "2019-09-17T07:41:08", "url": "https://files.pythonhosted.org/packages/74/c2/48376c3bf89eb3b5b5e010af72e1b56da00c18090492fc5060ad83d2edfd/ggtrans-2.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed1a034eef4c34d6fdb08b362c2afd5e", "sha256": "92b34b21fd4e922b8342529982e0e1ab6620c8b3ab8029bef3bb11f56e0130cf" }, "downloads": -1, "filename": "ggtrans-2.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ed1a034eef4c34d6fdb08b362c2afd5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7", "size": 16558, "upload_time": "2019-09-17T07:41:06", "url": "https://files.pythonhosted.org/packages/2f/30/3e4f26a83d65e2b2b3114203a7ec35c34663a0eae08939e92600a11134c2/ggtrans-2.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bccf5f7342c64e50af40e86a9c2ef13e", "sha256": "421ca4714792ef89a3377ab49ddf35841f7971764f6d35658db4e74dc7818380" }, "downloads": -1, "filename": "ggtrans-2.4.1.tar.gz", "has_sig": false, "md5_digest": "bccf5f7342c64e50af40e86a9c2ef13e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 17402, "upload_time": "2019-09-17T07:41:08", "url": "https://files.pythonhosted.org/packages/74/c2/48376c3bf89eb3b5b5e010af72e1b56da00c18090492fc5060ad83d2edfd/ggtrans-2.4.1.tar.gz" } ] }