A lightweight, simple Python wrapper for the Microsoft (Bing) Translation API that does the API call and returns the raw, unmanipulated result.
It saves you time whilst adding no more code to your project than necessary
Just run pip install MicroTranslator
in your command prompt of choice (e.g. Windows CMD or Powershell)
from microtranslator import Translator
tr = Translator(client_key="key")
tr.translate("Hello World!", "de")
# [{'detectedLanguage': {'language': 'en', 'score': 1.0}, 'translations': [{'text': 'Hallo Welt!', 'to': 'de'}]}]
tr.detect("Hallo Welt!")
#[{'language': 'de', 'score': 1.0, 'isTranslationSupported': True, 'isTransliterationSupported': False}]
tr.dictionary("test", "it", "en")
# text, to lang, from lang
# [{'normalizedTarget': 'fuoco', 'displayTarget': 'fuoco', 'posTag': 'OTHER', 'confidence': 0.8043, 'prefixWord': '', 'backTranslations':
# [{'normalizedText': 'fire', 'displayText': 'fire', 'numExamples': 1, 'frequencyCount': 33741},
# {'normalizedText': 'firing', 'displayText': 'firing', 'numExamples': 0, 'frequencyCount': 559}
# ]
# }]
# etc...
tr.languages()
# {'af': {'name': 'Afrikaans', 'nativeName': 'Afrikaans', 'dir': 'ltr'},
# 'am': {'name': 'Amharic', 'nativeName': 'አማርኛ', 'dir': 'ltr'}}
# etc...
View my discord bot which uses this exact package for all the free translations!
Go ahead and make a pull request! I should always be around to review them!
Make an issue! Try to add as much detail as possible, including screenshots and tracebacks are super useful