Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
:Version: 0.7 :Web: http://fulfil.io/ :keywords: Microsoft Translator :copyright: Fulfil.IO, Openlabs Technologies & Consulting (P) LTD :license: BSD
.. image:: https://secure.travis-ci.org/fulfilio/Microsoft-Translator-Python-API.png?branch=master :target: http://travis-ci.org/#!/fulfilio/Microsoft-Translator-Python-API
.. image:: https://coveralls.io/repos/fulfilio/Microsoft-Translator-Python-API/badge.png?branch=master :target: https://coveralls.io/r/fulfilio/Microsoft-Translator-Python-API
This python API implements the Microsoft Translator services which can be used in web or client applications to perform language translation operations. The services support users who are not familiar with the default language of a page or application, or those desiring to communicate with people of a different language group.
Example Usage: ::
>>> from microsofttranslator import Translator
>>> translator = Translator('<Your Client ID>', '<Your Client Secret>')
>>> print translator.translate("Hello", "pt")
"Olá"
To register your application with Azure DataMarket, visit https://datamarket.azure.com/developer/applications/ using the LiveID credentials from step 1, and click on “Register”. In the “Register your application” dialog box, you can define your own Client ID and Name. The redirect URI is not used for the Microsoft Translator API. However, the redirect URI field is a mandatory field, and you must provide a URI to obtain the access code. A description is optional.
Take a note of the client ID and the client secret value.
::
pip install microsofttranslator
Translation +++++++++++
::
>>> from microsofttranslator import Translator
>>> translator = Translator('<Your Client ID>', '<Your Client Secret>')
>>> print translator.translate("Hello", "pt")
"Olá"
Translate multiple words at once ++++++++++++++++++++++++++++++++
::
>>> from microsofttranslator import Translator
>>> translator = Translator('<Your Client ID>', '<Your Client Secret>')
>>> translator.translate_array(['apple', 'orange'], 'pt')
[{u'TranslatedText': u'Apple', u'From': u'en', u'OriginalTextSentenceLengths': [5], u'TranslatedTextSentenceLengths': [5]}, {u'TranslatedText': u'laranja', u'From': u'en', u'OriginalTextSentenceLengths': [6], u'TranslatedTextSentenceLengths': [7]}]
Get supported languages +++++++++++++++++++++++
::
>>> from microsofttranslator import Translator
>>> translator = Translator('<Your Client ID>', '<Your Client Secret>')
>>> print translator.get_languages()
[u'ar', u'bg', u'ca', u'zh-CHS', u'zh-CHT', u'cs', u'da', u'nl', u'en', u'et', u'fi', u'fr', u'de', u'el', u'ht', u'he', u'hi', u'mww', u'hu', u'id', u'it', u'ja', u'tlh', u'tlh-Qaak', u'ko', u'lv', u'lt', u'ms', u'mt', u'no', u'fa', u'pl', u'pt', u'ro', u'ru', u'sk', u'sl', u'es', u'sv', u'th', u'tr', u'uk', u'ur', u'vi', u'cy']
Detect Language +++++++++++++++
::
>>> from microsofttranslator import Translator
>>> translator = Translator('<Your Client ID>', '<Your Client Secret>')
>>> translator.detect_language('hello')
u'en'
FAQs
Microsoft Translator V2 - Python API
We found that microsofttranslator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.