Skip to content

z44d/trengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.tr.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.tr.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())

Thanks for: