Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ilevn/aiodictcc

An asyncio-based wrapper for dict.cc
https://github.com/ilevn/aiodictcc

aiohttp asnycio asynchronous dictionary python-3-6 translate wrapper

Last synced: about 1 month ago
JSON representation

An asyncio-based wrapper for dict.cc

Awesome Lists containing this project

README

        

## aiodictcc

An `asnycio`-based wrapper for [Dict.cc](https://dict.cc).

## Installation
```
pip install aiodictcc
```
For the latest development version:
```
pip install git+https://github.com/ilevn/aiodictcc
```
## Example

```py
import asyncio
from aiodictcc import Translate

# Create a new instance of the API wrapper.
trans = Translate()
loop = asyncio.get_event_loop()

async def main():
to_translate = input("Search: ")
# Get translation for `to translate` en -> de.
translated = await trans.get_translation(to_translate, "en", "de")
# Returns a list of tuples.
print(translated)

loop.run_until_complete(main())
```