A lightweight, simple to use wrapper for the Microsoft translate API.
Project description
Microsoft Translate Wrapper
A lightweight, simple to use wrapper for the microsoft translate API that simply does the API call and returns the raw, unmanipulated result.
Why Should I Use This?
It saves you time whilst adding no more code to your project than necessary
Installation
Just run pip install MicroTranslator
in your command prompt of choice (Eg. Windows CMD or Powershell)
Setup
from microtranslator import Translator
tr = Translator(client_key="key")
Translate
tr.translate("Hello World!", "de")
# [{'detectedLanguage': {'language': 'en', 'score': 1.0}, 'translations': [{'text': 'Hallo Welt!', 'to': 'de'}]}]
Detect
tr.detect("Hallo Welt!")
#[{'language': 'de', 'score': 1.0, 'isTranslationSupported': True, 'isTransliterationSupported': False}]
Dictionary
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...
Languages
tr.languages()
# {'af': {'name': 'Afrikaans', 'nativeName': 'Afrikaans', 'dir': 'ltr'},
# 'am': {'name': 'Amharic', 'nativeName': 'አማርኛ', 'dir': 'ltr'}}
# etc...
See it in the wild
View my discord bot which uses this exact package for all the free translations!
Have something to contribute?
Go ahead and make a pull request! I should always be around to review them!
Issues?
Make an issue! Try to add as much detail as possible, including screenshots and tracebacks are super useful
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
Built Distribution
File details
Details for the file MicroTranslator-1.0.2.tar.gz
.
File metadata
- Download URL: MicroTranslator-1.0.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ec772bcc02ecb658d5be4d524a57666b96f54d1c53bae2ae95f517f125b988d |
|
MD5 | dde60b879c47c17c99d9eb2a7dfbfac3 |
|
BLAKE2b-256 | 60a0fe781ce06f7634b7f3baacf5dd7402b59fc0f4caa952cd8b1b191de53126 |
File details
Details for the file MicroTranslator-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: MicroTranslator-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5373acb3314da4fbb2008da9ca6c12947a4cf82420be11a7f22de123a6812e68 |
|
MD5 | 3671eccb191039693f8ae40cd5e17936 |
|
BLAKE2b-256 | ff5a616c7d28be90a2ee935049e4c5f5b66f00a7fbd4ec2f1c2ccd48c0774626 |