Metadata-Version: 2.4
Name: adtr_client
Version: 0.0.5
Summary: A simple Python client for the [Adtr Translation/Synonymization API]
Author-email: pi11 <webii@pm.me>
License-Expression: WTFPL
Project-URL: Homepage, https://github.com/pi11/adtr_client
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: license-file

# Adtr Translation Client

A simple Python client for the [Adtr Translation API](https://aitr.webnova.one/docs).

## Installation

Install the client using pip:

```bash
pip install adtr_client
```

## Usage

Use the client to translate or creatively rewrite text via the Adtr Translation API.
The API accepts several languages, with English-to-Russian and Russian-to-English
as the primary translation directions.

### Translate English to Russian

```python
from adtr_client import translate

result = translate(
    user_id=123,
    api_key="your_api_key",
    text="English title to translate",
    source_language="en",
    target_language="ru",
)

print(result)
```

Use `source_language="Auto"` (the default) when the source language should be
detected automatically. Existing calls that only provide `target_language`
continue to work.

### Translate Russian to English

```python
from adtr_client import translate

result = translate(
    user_id=123,
    api_key="your_api_key",
    text="Текст для перевода",
    source_language="ru",
    target_language="en",
)

print(result)
```

### Creatively rewrite in the same language

```python
from adtr_client import synonymize

result = synonymize(
    user_id=123,
    api_key="your_api_key",
    text="Text to rewrite",
)

print(result)
```

## Configuration

1. Obtain your `user_id` and `api_key` from the rkn.name service
2. Replace the example credentials and text with your own values.
