Metadata-Version: 2.1
Name: py-trans
Version: 0.6
Summary: Free python library to translate text to different languages.
Home-page: https://github.com/Itz-fork/py-trans
Download-URL: https://github.com/Itz-fork/py-trans/releases/tag/py-trans-pypi-v0.6
Author: Itz-fork
Author-email: git.itzfork@gmail.com
License: MIT
Keywords: google translate,text translator,translator,py-trans
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: aiohttp

# py-trans
```py
from py_trans import PyTranslator

tr = PyTranslator()
print(tr.google("Hi", "es"))
```

<p align="center">
  A Fast, hassle-free way to translate text 📖
<p>

<p align="center">
  <kbd><a href="#features"><b>Features</b></a></kbd>
  <kbd><a href="#installation"><b>Install</b></a></kbd>
  <kbd><a href="#usage"><b>Usage</b></a></kbd>
</p>


## Features
- Simple and free
- Multiple translators to choose
- Both synchronous & asynchronous versions


## Supported translators
|                      Engine                      |   Function   |
| ------------------------------------------------ | --------------- |
|[Google Translate](https://translate.google.com/) | `google`        |
|[translate.com](https://www.translate.com/)       | `translate_com` |
|[MyMemory](https://mymemory.translated.net/)      | `my_memory`     |
|[Translate Dict](https://www.translatedict.com/)  | `translate_dict`     |


## Installation

```sh
pip3 install py-trans
```

<details>
  <summary><b>Install from source</b></summary>

  ```sh
  pip install git+https://github.com/Itz-fork/py-trans.git
  ```
</details>


## Usage

```py
# Sync version
from py_trans import PyTranslator

# Async version
from py_trans import Async_PyTranslator
```

- Detect language of the provided text
    - `detect`
    - 
        ```py
        tr.detect("Hello!")
        ```
- Translate text using Google translate
    - `google`
    - 
        ```py
        tr.google("Hello!", "es")
        ```
- Translate text using Translate.com
    - `translate_com`
    - 
        ```py
        tr.translate_com("Hello!", "es")
        ```
- Translate text using My Memory
    - `my_memory`
    - 
        ```py
        tr.my_memory("Hello!", "es")
        ```
- Translate text using Translate dict
    - `translate_dict`
    - 
        ```py
        tr.translate_dict("Hello!", "es")
        ```

> [!NOTE]
> All the above examples also applies to async version


## License
- Copyright (C) 2023 [@Itz-fork](https://github.com/Itz-fork)
- Licensed under [MIT](/LICENSE)
