Metadata-Version: 2.4
Name: egune
Version: 1.0.1
Summary: Egune Library
Author: Bilguun Chinzorig
Author-email: bilguun@bolorsoft.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.23.0
Requires-Dist: minio>=7.1.0
Requires-Dist: msgpack>=1.0.0
Requires-Dist: pyzmq>=25.0.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: typing-extensions>=4.0.0; python_version < "3.8"
Requires-Dist: dataclasses; python_version < "3.7"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# Egune Python Client Library

Async Python client for the Chibolegune API, providing easy access to speech, text, OCR, embedding, and video generation services.

## Installation

```bash
pip install .
```

## Features
- Speech-to-Text (STT)
- Text-to-Speech (TTS)
- Punctuation restoration
- Language detection
- Latin to Cyrillic conversion
- Text embedding
- OCR (Optical Character Recognition)
- Kimo (Traditional <-> Cyrillic)
- Video generation
- Low-level ZMQ client for advanced use

## Quickstart Example

```python
import asyncio
from egune import EguneClient

async def main():
    async with EguneClient("http://localhost:8000") as client:
        # Speech-to-Text
        with open("audio.wav", "rb") as f:
            audio_bytes = f.read()
        stt_result = await client.stt(audio=audio_bytes, model="citrinet", audio_dtype="int16")
        print("STT:", stt_result.full_text)

        # Text-to-Speech
        tts_result = await client.tts("Сайн уу")
        print("TTS audio URL:", tts_result.audio_url)

        # Punctuation
        punctuated = await client.punctuate("sain uu")
        print("Punctuated:", punctuated)

        # Language Detection
        lang = await client.detect_language(text="Hello world")
        print("Language:", lang.language)

        # Latin to Cyrillic
        cyrillic = await client.latin_to_cyrillic("sain uu")
        print("Cyrillic:", cyrillic)

        # Embedding
        emb = await client.embed(text="Hello world")
        print("Embedding (first 5):", emb.embedding[:5])

        # OCR
        with open("image.png", "rb") as f:
            image_bytes = f.read()
        ocr = await client.ocr(image=image_bytes)
        print("OCR blocks:", ocr.blocks)

        # Kimo
        kimo_text = await client.kimo("ᠰᠠᠢᠨ ᠤ", direction="traditional->cyrillic")
        print("Kimo:", kimo_text)

        # Video Generation
        video_job = await client.generate_video(image_path="face.png", prompt="A person is talking")
        print("Video job status:", video_job.status)

asyncio.run(main())
```

## REST Endpoints (Summary)
- `/stt/` — Speech-to-text (audio bytes or MinIO path)
- `/tts/` — Text-to-speech
- `/punctuator/` — Restore punctuation
- `/language-detector/` — Detect language
- `/latin-to-cyrillic/` — Convert Latin to Cyrillic
- `/embedder/` — Text embedding
- `/ocr/` — OCR from image
- `/kimo/` — Traditional <-> Cyrillic conversion
- `/video-generation/` — Video generation

See the [docs/endpoints.md](../../docs/endpoints.md) for full details.

## Advanced: ZMQClient
For low-latency, internal service-to-service calls, use `egune.ZMQClient`:

```python
from egune import ZMQClient

async def zmq_example():
    async with ZMQClient("tcp://localhost:5600") as client:
        meta, data = await client.call("whisper", {"dtype": "int16"}, audio_bytes)
```
