Skip to main content

A simple wrapper of googletrans

Project description

A simple wrapper for googletrans

Features

  • default translate to Chinese
  • file or text
  • auto split with nltk when characters exceed 5000

Installation

pip install simple-googletrans

Usage

from simple_googletrans import GoogleTrans

t = GoogleTrans()
t.translate('hello world')

t = GoogleTrans(url='translate.google.com', proxies={'https': 'https://127.0.0.1:1080'}, timeout=15)
t.translate('hello world', dest='fr')

Command Line

gtranslate "hello world!"

gtranslate README.md

gtranslate README.md -o README.cn.txt

# list all languages
gtranslate -l

# use a proxy
gtranslate --proxy 181.211.145.46:8080 README.md

# other options
gtranslate -d fr hello world

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

simple-googletrans-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file simple-googletrans-1.0.0.tar.gz.

File metadata

  • Download URL: simple-googletrans-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for simple-googletrans-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0bf3dc3a3493add6557636e5efe334bcb8740e49d026c847b2ae591658e873e4
MD5 c2d35773b3a02f8ac88737075c34b6e2
BLAKE2b-256 2c9e1faf29074e3ccb4392c7f19768bc5c9de3697392f7c8221d8ed2b348c006

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