Skip to main content

Free python library to translate text to different languages.

Project description

py-trans

from py_trans import PyTranslator

tr = PyTranslator()
print(tr.google("Hi", "es"))

A Fast, hassle-free way to translate text 📖

Features Install Usage

Features

  • Simple and free
  • Multiple translators to choose
  • Both synchronous & asynchronous versions

Supported translators

Engine Function
Google Translate google
translate.com translate_com
MyMemory my_memory
Translate Dict translate_dict

Installation

pip3 install py-trans
Install from source
pip install git+https://github.com/Itz-fork/py-trans.git

Usage

# Sync version
from py_trans import PyTranslator

# Async version
from py_trans import Async_PyTranslator
  • Detect language of the provided text
    • detect
    • tr.detect("Hello!")
      
  • Translate text using Google translate
    • google
    • tr.google("Hello!", "es")
      
  • Translate text using Translate.com
    • translate_com
    • tr.translate_com("Hello!", "es")
      
  • Translate text using My Memory
    • my_memory
    • tr.my_memory("Hello!", "es")
      
  • Translate text using Translate dict
    • translate_dict
    • tr.translate_dict("Hello!", "es")
      
  • Get language code/name

      ```py
      # Sync version
      tr.get_lang_code("arabic")
      tr.get_lang_name("ar")
    
      # Async version
      tr.get_lang_code_async("arabic")
      tr.get_lang_name_async("ar")
      ```
    

[!NOTE] All the above examples also applies to async version (Async_PyTranslator)

License

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

py-trans-0.6.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

py_trans-0.6.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file py-trans-0.6.1.tar.gz.

File metadata

  • Download URL: py-trans-0.6.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for py-trans-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9f049db5b6f3676a4917bf60804716b3bb52457b907994e142c2893f150b8c60
MD5 c55e526d9c76e7f8ade65d212fe6dc9d
BLAKE2b-256 7248eb302dc35e1695d9eded00e270d4419a2d82f2740413943ed5ecc931ca14

See more details on using hashes here.

File details

Details for the file py_trans-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: py_trans-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for py_trans-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5441206dfcbce16e6407e8959432061583e466e9b5ba94a174fac9449a61c7d5
MD5 30b896e3816207b44e80806fe037e2b1
BLAKE2b-256 f2b50a2e7fd5a2f6db3f882b7524b63f3b9c71cf8248f55abeb1064994693912

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