{ "info": { "author": "Sergii Chernenko", "author_email": "4e.sergei@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "============\ngtrans\n============\n\nFree Google Translate API. It works with selenium and Chrome.\nFor each translation it uses public Google Translate web service.\n\nRequerements:\n-------------\n\n* Python 3.6\n* [Google Chrome](https://www.google.com/chrome/)\n* [selenium](http://selenium-python.readthedocs.io/installation.html)\n* [lxml](http://lxml.de/)\n* [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)\n* [nltk](https://www.nltk.org/)\n\nFeatures\n--------\n* Text translation\n* HTML markuped text translation\n\n\nInstallation\n------------\n::\n\n $ pip install gtrans\n\nExample usage\n-------------\n.. code-block:: python\n\n from gtrans import translate_text, translate_html\n\n text = '''\n Jones and Palin met at Oxford University, where they performed together \n with the Oxford Revue. Chapman and Cleese met at Cambridge University. \n Idle was also at Cambridge, but started a year after Chapman and Cleese.\n '''\n\n html = '''\n
\u041d\u0438\u043b \u0410\u0440\u043c\u0441\u0442\u0440\u043e\u043d\u0433 \u0440\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u0433\u043e\u0440\u043e\u0434\u0435 \u0423\u0430\u043f\u0430\u043a\u043e\u043d\u0435\u0442\u0430, \u0448\u0442\u0430\u0442 \u041e\u0433\u0430\u0439\u043e,\n \u0432 \u0441\u0435\u043c\u044c\u0435 \u0421\u0442\u0438\u0432\u0435\u043d\u0430 \u0410\u0440\u043c\u0441\u0442\u0440\u043e\u043d\u0433\u0430 \u0438 \u0412\u0438\u043e\u043b\u044b \u042d\u043d\u0433\u0435\u043b\u044c.
\n\u0420\u043e\u0434\u0438\u043b\u0441\u044f 5 \u0430\u0432\u0433\u0443\u0441\u0442\u0430 1930 \u0433\u043e\u0434\u0430. \u041e\u043d \u0438\u043c\u0435\u043b \u0448\u043e\u0442\u043b\u0430\u043d\u0434\u0441\u043a\u043e-\u0438\u0440\u043b\u0430\u043d\u0434\u0441\u043a\u043e\u0435\n \u0438 \u043d\u0435\u043c\u0435\u0446\u043a\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435.
\n\u0423 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u0438 \u043c\u043b\u0430\u0434\u0448\u0438\u0435 \u0441\u0435\u0441\u0442\u0440\u0430 \u0438 \u0431\u0440\u0430\u0442: \u0414\u0436\u0443\u043d \u0438 \u0414\u0438\u043d. \u041e\u0442\u0435\u0446,\n \u0421\u0442\u0438\u0432\u0435\u043d \u0410\u0440\u043c\u0441\u0442\u0440\u043e\u043d\u0433, \u0440\u0430\u0431\u043e\u0442\u0430\u043b\n \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u043e\u043c \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0448\u0442\u0430\u0442\u0430, \u0438 \u043f\u043e\u0441\u043b\u0435 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u041d\u0438\u043b\u0430\n \u0441\u0435\u043c\u044c\u044f \u0447\u0430\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u043b\u0430 \u0438\u0437\n \u0433\u043e\u0440\u043e\u0434\u0430 \u0432 \u0433\u043e\u0440\u043e\u0434: \u043e\u043d\u0438 \u0443\u0441\u043f\u0435\u043b\u0438 \u043f\u043e\u0436\u0438\u0442\u044c \u0432 \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445\n \u0433\u043e\u0440\u043e\u0434\u0430\u0445 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\n \u043e\u0441\u0435\u043b\u0438 \u0432 \u0423\u0430\u043f\u0430\u043a\u043e\u043d\u0435\u0442\u0435 (\u0448\u0442\u0430\u0442 \u041e\u0433\u0430\u0439\u043e) \u0432 1944 \u0433\u043e\u0434\u0443.
\n '''\n\n print('*'*50)\n print(translate_text(text, 'en', 'ru'))\n print('='*50)\n print(translate_html(html, 'ru', 'en'))\n print('*'*50)\n\nOutput\n------\n.. code-block::\n\n **************************************************\n \u0414\u0436\u043e\u043d\u0441 \u0438 \u041f\u044d\u0439\u043b\u0438\u043d \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u041e\u043a\u0441\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Oxford Revue. \n \u0427\u0435\u043f\u043c\u0435\u043d \u0438 \u041a\u043b\u0438\u0437 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438\u0441\u044c \u0432 \u041a\u0435\u043c\u0431\u0440\u0438\u0434\u0436\u0441\u043a\u043e\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435. \u0418\u0434\u043b \u0431\u044b\u043b \u0442\u0430\u043a\u0436\u0435 \u0432 \u041a\u0435\u043c\u0431\u0440\u0438\u0434\u0436\u0435, \u043d\u043e \u043d\u0430\u0447\u0430\u043b \u0447\u0435\u0440\u0435\u0437 \n \u0433\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u0427\u0435\u043f\u043c\u0435\u043d\u0430 \u0438 \u041a\u043b\u0438\u0441\u0430.\n ==================================================\nNeil Armstrong was born in Huapakoneta, Ohio, to the family \n of Stephen Armstrong and Viola Engel.
He was born on August 5, 1930. He had Scottish-Irish \n and German descent.
He had a younger sister and brother: June and Dean. Father Steven Armstrong \n worked as an auditor for the state government, and after the birth of Neil, the family often moved \n from city to city: they managed to live in twenty different cities before finally settling in Wapakonet, \n Ohio, in 1944.
\n **************************************************\n\nChangelog\n---------\n\n0.2\n~~~\n\n* updates in modules\n* multithreading mode\n* updates in markuped text translation\n* change PhantomJS to Chromedriver\n\n0.1\n~~~~~\n\n* First published working version.\n\nAuthor\n------\n\nSergii Chernenko