Metadata-Version: 2.4
Name: translatenets
Version: 0.1.0
Summary: Python client for the TranslateNets API.
Author-email: Nathan <support@translatenets.com>
License: MIT License
        
        Copyright (c) [2026] [TranslateNets]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://translatenets.com
Project-URL: Repository, https://github.com/TranslateNets/translatenets-python
Project-URL: Issues, https://github.com/TranslateNets/translatenets-python/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx<1.0,>=0.28
Dynamic: license-file

# TranslateNets Python SDK

Python client for the [TranslateNets](https://translatenets.com) API: translate text, images (PNG, JPEG, WebP), and Word documents (`.docx`).

**Requirements:** Python 3.10+

## Install

```bash
pip install translatenets
```

## Authentication

Create an API key at [translatenets.com/dashboard/api-keys](https://translatenets.com/dashboard/api-keys) and set `TRANSLATENETS_API_KEY`, or pass `api_key=` to `Translator`.

## Usage

```python
import os

from translatenets.client import Translator

t = Translator(api_key=os.environ["TRANSLATENETS_API_KEY"])

# Text — returns JSON from the API (e.g. translated fields)
t.translateText("Hello, world!", target_language="jp")

# Image — path to PNG/JPEG/WebP; response includes a data URL under `image`
t.translateImage("/path/to/image.png", target_language="jp")

# Optional: write translated binary to disk (same idea for documents)
t.translateImage("/path/to/image.png", target_language="jp", save_path="/path/to/out.png")

# Document — `.docx` only, max 20 MB per file
t.translateDocument("/path/to/doc.docx", target_language="jp", save_path="/path/to/out.docx")

# Supported language codes (also available programmatically)
t.getLanguages()  # e.g. "en", "jp"
```

Optional arguments on translate methods:

- `source_language` — omit for auto-detection where supported.
- `provider` — one of `grok`, `openai`, `claude`, `gemini` (default on the client is `grok`).

**Limits:** text input up to 80,000 characters; images up to 10 MB.

## Contributing

1. Get an API key from [TranslateNets](https://www.translatenets.com/dashboard/api-keys) and copy `.env.example` to `.env` with `TRANSLATENETS_API_KEY` set.
2. Clone the repo and install with [uv](https://docs.astral.sh/uv/):

   ```bash
   git clone https://github.com/TranslateNets/translatenets-python.git
   cd translatenets-python
   uv sync --group dev
   ```

3. Run tests:

   ```bash
   uv run pytest
   ```
