Skip to main content

Free Google translate module that uses async/await syntax.

Project description

aiotranslate

Free google translate module that uses async/await syntax.

Example

from aiotranslate import Translator
import asyncio

async def main():
    translator = Translator() 

    # you can add aiohttp session if you want like -> Translator(session=aiohttp.ClientSession())
    # also you can save the translates like -> Translator(save_translates=True)
    
    translated = await translator.translate("hello", "tr", "en")

    # first argument: the text will be translated
    # second argument: the language will converted
    # last argument: the language that text

    print(translated) # -> Merhaba
    print(translator.history()) # shows all translates that saved.

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(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

aiotranslate-0.0.1.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file aiotranslate-0.0.1.tar.gz.

File metadata

  • Download URL: aiotranslate-0.0.1.tar.gz
  • Upload date:
  • Size: 2.2 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.59.0 CPython/3.6.0

File hashes

Hashes for aiotranslate-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f089c4aae8a32c076260c950168d24a015d48006f4f65688a8d4cfe13ad4d594
MD5 f2488b123bd136e0f493e8dd5d89453e
BLAKE2b-256 54405831af46715881b735b3bdf0f69f024aaf14a4e166e0a387b28ad62581b3

See more details on using hashes here.

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