Skip to main content

TREngine is python library based on 4 translators engines

Project description

Install:

pip install trengine

About this project:

How to use?

  • Here an example to use it:
from trengine import Engine

eng = Engine()
text = "Hola, mi amor"

print(
    eng.google.translate(text, "en"), "\n",
    eng.ajax.translate(text, "en"), "\n",
    eng.hozory.translate(text, "en"), "\n",
    eng.tdict.translate(text, "en"), "\n",
)

# OCR
print(eng.ocr.from_image("./test.png"))
  • Here an async example:
import asyncio
from trengine import AsyncEngine

eng = AsyncEngine()
text = "Hola, mi amor"

async def main():
    print(
        await eng.google.translate(text, "en"), "\n",
        await eng.ajax.translate(text, "en"), "\n",
        await eng.hozory.translate(text, "en"), "\n",
        await eng.tdict.translate(text, "en"), "\n",
    )

    # OCR
    print(await eng.ocr.from_image("./test.png"))

asyncio.run(main())

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

trengine-1.5.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

trengine-1.5-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page