Skip to main content

free translator by google or bing

Project description

translation_google_bing

###free Bing and Google translation API

####trans-google-bing Version 0.0.2 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 0.0.2 have fixed url translate. Ps: If your get translations for different genders, it will return a list. https://support.google.com/translate/answer/9179237?p=gendered_translations&hl=zh-Hans&visit_id=637425624803913067-1347870216&rd=1

####Installation pip install trans-google-bing ####Basic Usage of Google Translation #####Translate

from google_bing_trans import Google_translator 
translator = Google_translator()
text = translator.translate('你好', dest='en')
print(text)

-> Hello

####Advanced Usage #####Translate

from google_bing_trans import Google_translator 
You can set the service_url according to your needs. for example: service_url= "translation.google.com"
it is default "translation.google.cn" if you not to set service_url
translator = Translation(service_url = "translation.google.com")  

default parameter : dest=auto src=auto
For src param is not to set, because API can automatically identify the src translation language
from google_bing_trans import Google_translator
translator = Google_translator()
text = translator.translate('你好', dest='en')
print(text)
-> hello

#####Detect

from google_bing_trans import Google_translator

detector = Google_translator() 
text = detector.detect("こんにちは")
print(text)

-> ['ja', 'japanese']

####Basic Usage of Bing Translation #####Translate

from google_bing_trans import bing_translator 
translator = bing_translator()
text = translator.translator('你好', to='en')
print(text)

-> Hello

#####Detect

from google_bing_trans import bing_translator

detector = bing_translator() 
text = detector.detect("こんにちは")
print(text)

-> 'ja'

Prerequisites Python >=3.6 requests

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

trans_google_bing-0.0.2.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file trans_google_bing-0.0.2.tar.gz.

File metadata

  • Download URL: trans_google_bing-0.0.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.6

File hashes

Hashes for trans_google_bing-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d56623d6cb0faaeb22487c0c797d2040e1b9672782c53c36133b7427de6bd19d
MD5 875a70fdda95069d8baeecec039ed163
BLAKE2b-256 5d67724cc88f231fac46193568dc050af4a3f3cf0967380669440bf03963cd72

See more details on using hashes here.

Supported by

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