Skip to main content

A free and unlimited python tools for google translate api.

Project description

google_trans_new

Version 1.1.0

A free and unlimited python API for google translate.
It's very easy to use and solve the problem that the old api which use tk value cannot be used.
This interface is for academic use only, please do not use it for commercial use.

Version 1.1.0 fixed many issues.


Installation

pip install google_trans_new

Basic Usage

Transalte

from google_trans_new import google_translator  

translator = google_translator(url_suffix='cn',timeout=5)  
# <Translate url_suffix=cn timeout=5>  
#  default parameter : url_suffix="cn" timeout=5
#  url_suffix="cn" use in https://translate.google.{}/ 
translate_text = translator.translate('สวัสดีจีน',lang_tgt='en',lang_src='th' )  
# <Translate text=สวัสดีจีน lang_tgt=th lang_src=en>  
#  default parameter : lang_src=auto lang_tgt=auto 
#  API can automatically identify the src translation language, so you don’t need to set lang_src
print(translate_text)
-> Hello china

Detect

from google_trans_new import google_translator  

detector = google_translator()  
detect_result = detector.detect('สวัสดีจีน')
# <Detect text=สวัสดีจีน >  
print(detect_result)
-> ['th', 'thai']

Prerequisites

  • Python >=3.6
  • requests
  • six

License

google_trans_new is licensed under the MIT License. The terms are as follows:

MIT License  

Copyright (c) 2020 lushan88a  

Permission is hereby granted, free of charge, to any person obtaining a copy  
of this software and associated documentation files (the "Software"), to deal  
in the Software without restriction, including without limitation the rights  
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  
copies of the Software, and to permit persons to whom the Software is  
furnished to do so, subject to the following conditions:  

The above copyright notice and this permission notice shall be included in all  
copies or substantial portions of the Software.  

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  
SOFTWARE.  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_trans_new-1.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_trans_new-1.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file google_trans_new-1.1.0.tar.gz.

File metadata

  • Download URL: google_trans_new-1.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.4

File hashes

Hashes for google_trans_new-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4c36215a16767229b8d3ce9437837c7468ccba9e3eabf39a98a0c67a6b19786c
MD5 6e590d54bbf7e5292cc7fd778692bfd4
BLAKE2b-256 619b78b387989f3f6d7dc1b5ab27864a84a09b1f16ee5e023fd4286c5e5052b6

See more details on using hashes here.

File details

Details for the file google_trans_new-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: google_trans_new-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.4

File hashes

Hashes for google_trans_new-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f21378b211b83fecb44139f4088ea2c4ebc407f5ce8d9166682b330ed397aa71
MD5 5cc1240432fa7d683f8799b82f3d4f46
BLAKE2b-256 2bc711badc10857b5167d83377655569623a045bccd88205ed451d3051699794

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page