Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dedinc/mintrans
Mintrans is a free API wrapper that utilizes Bing, DeepL, and Google Translate for translation purposes.
https://github.com/dedinc/mintrans
api-wrapper bing-translate bing-translator i18n language microsoft-translator microsoft-translator-api translate translation translator unofficial-library
Last synced: about 1 month ago
JSON representation
Mintrans is a free API wrapper that utilizes Bing, DeepL, and Google Translate for translation purposes.
- Host: GitHub
- URL: https://github.com/dedinc/mintrans
- Owner: DedInc
- License: mit
- Created: 2023-03-05T14:47:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T03:20:54.000Z (about 2 months ago)
- Last Synced: 2024-12-13T03:58:16.713Z (about 2 months ago)
- Topics: api-wrapper, bing-translate, bing-translator, i18n, language, microsoft-translator, microsoft-translator-api, translate, translation, translator, unofficial-library
- Language: Python
- Homepage: https://pypi.org/project/mintrans/
- Size: 4.88 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# πΊοΈ mintrans - A translation API wrapper πΊοΈ
mintrans is a free API wrapper that utilizes Bing, DeepL, and Google Translate for translation purposes. π€
## π‘ How to use π‘
```python
from mintrans import BingTranslator, DeepLTranslator, GoogleTranslator
from mintrans import RateLimitExceptiontext = 'Hello World!'
from_lang = 'en'
to_lang = 'fr'# Bing Translator
bing_translator = BingTranslator()
bing_translation = bing_translator.translate(text, from_lang, to_lang)
print(bing_translation)# DeepL Translator
deepl_translator = DeepLTranslator()
try:
deepl_translation = deepl_translator.translate(text, from_lang, to_lang)
print(deepl_translation)
except RateLimitException:
print('Limit of DeepL Translator reached!')# Google Translator
google_translator = GoogleTranslator()
google_translation = google_translator.translate(text, from_lang, to_lang)
print(google_translation)
```## π Features π
- Bing, DeepL and Google translators for more translation options!
- Easy switching between translators.
- Supports 100+ languages across translators. π## π Examples π
```python
text = 'This is a longer text to test the translation.'bing_translation = bing_translator.translate(text, 'en', 'es')
deepl_translation = deepl_translator.translate(text, 'en', 'de')
google_translation = google_translator.translate(text, 'en', 'fr')
```