Skip to main content

Egune Library

Project description

Egune Python Client Library

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

Installation

pip install .

Features

  • Speech-to-Text (STT) with dual-channel and streaming support.
  • Text-to-Speech (TTS) with actor presets, voice cloning, and emotional synthesis.
  • Punctuation restoration for unpunctuated text.
  • Language detection for Mongolian and English.
  • Latin to Cyrillic transliteration.
  • Text embedding for semantic similarity.
  • OCR for extracting text from images.
  • Kimo for Traditional <-> Cyrillic conversion.
  • Video generation from prompts and images.

Quickstart Example

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("234")
        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("2", 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 for full details.

Advanced: ZMQClient

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

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

egune-1.0.2.tar.gz (11.3 kB view details)

Uploaded Source

File details

Details for the file egune-1.0.2.tar.gz.

File metadata

  • Download URL: egune-1.0.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for egune-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d3dd826b9beb05e1a185e267e5941476b7f31905379d0411df643505f1eaf116
MD5 c4c6d7e8372ad8556432144defc987ee
BLAKE2b-256 072917c7d956667ab7d2b855312bbfca8f2d5f5ca6164764bd8ac637ebb72bb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page