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)
  • 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

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 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.1.tar.gz (12.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: egune-1.0.1.tar.gz
  • Upload date:
  • Size: 12.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.1.tar.gz
Algorithm Hash digest
SHA256 de863f595a7284b91ec2b66638c6a2c9a933197ccf7a5d34f15daf6bab475a5b
MD5 097e288b75c3c8032424eecf832c445b
BLAKE2b-256 7a14c0d3a7d302abb73b710a6341a621fc2e4b24423a878b07bfe1eceb793bb6

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