Skip to content

Automatically selects the best translation API and falls back to offline translators on failure.

Notifications You must be signed in to change notification settings

oy3o/translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translator

Automatically selects the best translation API and falls back to native translators on failure.

Auto Endpoint

from oy3opy.translator import auto_endpoint, translate
# find the endpoints with the highest availability
auto_endpoint('en', 'zh', proxies = { 'https://': 'http://127.0.0.1:1081' })
# translate with auto endpoint
translate('hello', 'en', 'zh')
# full arguments call
translate(text = 'hello', src='en', dest='zh', endpoints = ['bing','deepl'], proxies = { 'https://': 'http://127.0.0.1:1081' }, timeout = 4)

Manually Endpoint

from oy3opy.translator import check_performace
print(check_performace(src='en', dest='zh', endpoints=['None','or','list','of','endpoint'], text = 'None or custom', proxies={}))
# result: ('bing', 'translation') ('deepl', 'translation') ('iciba', 'translation')

Dependencies

About

Automatically selects the best translation API and falls back to offline translators on failure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages