Giter Club home page Giter Club logo

py-trans's Introduction

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

    # 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

py-trans's People

Contributors

itz-fork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

py-trans's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.