gtrans
Free Google Translate API. It works with selenium and Chrome. For each translation it uses public Google Translate web service.
Requerements:
Python 3.6
[Google Chrome](https://www.google.com/chrome/)
[selenium](http://selenium-python.readthedocs.io/installation.html)
[lxml](http://lxml.de/)
[Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/)
[nltk](https://www.nltk.org/)
Features
Text translation
HTML markuped text translation
Installation
$ pip install gtrans
Example usage
from gtrans import translate_text, translate_html
text = '''
Jones and Palin met at Oxford University, where they performed together
with the Oxford Revue. Chapman and Cleese met at Cambridge University.
Idle was also at Cambridge, but started a year after Chapman and Cleese.
'''
html = '''
<h1>Нил Армстронг</h1>
<p>Нил Армстронг родился в городе Уапаконета, штат Огайо,
в семье Стивена Армстронга и Виолы Энгель.</p>
<p>Родился 5 августа 1930 года. Он имел шотландско-ирландское
и немецкое происхождение.</p>
<p>У него были младшие сестра и брат: Джун и Дин. Отец,
Стивен Армстронг, работал
аудитором на правительство штата, и после рождения Нила
семья часто переезжала из
города в город: они успели пожить в двадцати различных
городах до того, как окончательно
осели в Уапаконете (штат Огайо) в 1944 году.</p>
'''
print('*'*50)
print(translate_text(text, 'en', 'ru'))
print('='*50)
print(translate_html(html, 'ru', 'en'))
print('*'*50)
Output
**************************************************
Джонс и Пэйлин встретились в Оксфордском университете, где они выступали вместе с Oxford Revue.
Чепмен и Клиз встретились в Кембриджском университете. Идл был также в Кембридже, но начал через
год после Чепмена и Клиса.
==================================================
<h1>Neil Armstrong</h1> <p>Neil Armstrong was born in Huapakoneta, Ohio, to the family
of Stephen Armstrong and Viola Engel.</p> <p>He was born on August 5, 1930. He had Scottish-Irish
and German descent.</p> <p>He had a younger sister and brother: June and Dean. Father Steven Armstrong
worked as an auditor for the state government, and after the birth of Neil, the family often moved
from city to city: they managed to live in twenty different cities before finally settling in Wapakonet,
Ohio, in 1944.</p>
**************************************************
Changelog
0.2
updates in modules
multithreading mode
updates in markuped text translation
change PhantomJS to Chromedriver
0.1
First published working version.
Metadata
Release files for gtrans 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gtrans-0.2.tar.gz | 3.8 MB | Without provenance | Details for gtrans-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gtrans-0.2-py3-none-any.whl | Python 3 | none | any | Details for gtrans-0.2-py3-none-any.whl |
Total release size: 7.6 MB
Release files / gtrans-0.2.tar.gz
| Download URL | gtrans-0.2.tar.gz |
|---|---|
| Size | 3.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd4376d6c801aeb14e0451a9e3cb7bf4d3e259c6ecc3210460e8ea87c1b868d3
|
|
BLAKE2b-256 checksum How to use checksums |
95bac96ae73453c4f40affc3b0929afb479ef9ae983fc33d97e90483ec489c26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / gtrans-0.2-py3-none-any.whl
| Download URL | gtrans-0.2-py3-none-any.whl |
|---|---|
| Size | 3.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56e133d2b5350e8bc81a07946a49ab44b59f52e85187ce5548631cf631ce7129
|
|
BLAKE2b-256 checksum How to use checksums |
dc3e5851438683ad69fdb60e1ad2058dad373ab8c7fe06bb738fb7b6d3e66133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for gtrans 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.