ptranslator

Simple yet effective module for translating that uses Google Translate


License
MIT
Install
pip install ptranslator==1.5.3

Documentation

python-translator

Simple yet effective module for translating.

Uses requests to access https://translate.google.com/ and fetches the translated text.

installation:

PyPI

  • Windows:

    pip install ptranslator

    Dont forget to add "<path_to_python>/Scripts" to PATH

  • Linux:

    sudo pip install ptranslator

    Probably won't run unless you use sudo when installing

  • installation problems:

    In this case refer to this article or if you need any aditional help please feel free to contact me :)

Usage:

ptranslator "text" to_language(default=en) from_language(optional)

  • In command line:
    > ptranslator "Hallo Welt!"
    Hello World!
    > ptranslator "Здраво Свете!" en
    Hello World!
    > ptranslator "Hola Mundo!" en es
    Hello World!
    
  • in python script:
    from ptranslator import translate
    # translate( text , to_language , from_language )
    translate("Hello World!", "de")  #second and third arguments are optional
    #output: Hallo Welt!