Skip to main content

Ingest text (txt/md/pdf/docx/images), translate, and synthesize audio.

Project description

plycast

Python License: MIT Version

Ingest text from common formats, translate in chunks, synthesize audio — as a Python library you import and a CLI you run on the same implementation.


Table of contents

About

This repository contains:

Piece What it is
Library Importable package plycast: providers (translators, TTS), services, pipelines, and PlycastPipeline for end-to-end runs from Python.
CLI Commands plycast and python -m plycast.cli — thin wrapper around the same pipeline code; useful for scripts and automation.

Together they cover: plain text and Markdown; optional PDF/Word (extra deps); images via OCR (Pillow + pytesseract + system Tesseract); translation through LibreTranslate, vendor LLMs, or identity passthrough; speech via macOS say (with optional ffmpeg for mp3/wav/m4a) or a text-only artifact for CI.

The default CLI translator is LibreTranslate, which you can self-host or use against a public instance, depending on your --base-url.

Choosing a translator: --translator llm (OpenAI or Anthropic) is aimed at natural, fluent output—well suited to audiobook-style listening when you want the model’s tone and wording. LibreTranslate is a free, open stack you can run yourself; it is a strong fit when you want a draft to review and edit (adjust the translated .txt, then regenerate audio) or to keep costs and data policy simple.

Install: after the package is on PyPI, use pip install plycast (like any other library). Until then, install from a clone or git URL — see docs/QuickStart.md. Maintainers: docs/Publishing.md explains how to upload to PyPI.

Features

  • Input: .txt, .md; optional .pdf / .docx (pip install ".[docs]"); images with OCR and --source-lang for Tesseract languages (e.g. zh).
  • Translation: chunked text; LLM path for natural tone; LibreTranslate for a free, self-hostable draft you can review and edit; Identity, OpenAI, Anthropic, unified LLM routing (LLMTranslator).
  • Audio: SystemSayTTS, TextFileTTS; configurable format and voice.
  • CLI: flags for translator, languages, API keys, TTS, chunk size — see QuickStart.

Architecture

  1. plycast.providers — vendor code (HTTP clients, auth, translators, TTS), plus base protocols, llm, translation_prompt.
  2. plycast.servicesTranslateService, ReadTextService, AudioService (including static factory methods for wiring).
  3. plycast.pipelines — composed flows: read-only, read→translate, read→translate→audio, read→audio.
  4. PlycastPipeline + plycast.cli — convenience wrapper and command-line entry points.

Implement custom backends against TranslatorProvider and TTSProvider in plycast.providers.base.

Documentation

Doc Contents
docs/QuickStart.md Install, prerequisites, CLI, LibreTranslate Docker, LLM examples, Python API, env vars, troubleshooting
docs/Publishing.md How to publish to PyPI so users can pip install plycast
This README Project introduction and layout

License

Released under the MIT License.

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

plycast-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plycast-0.1.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file plycast-0.1.0.tar.gz.

File metadata

  • Download URL: plycast-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plycast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16027d7607406d68542be2bd0c7c4cfdfe25fcb52c3b20e0d229de0adbac31c0
MD5 1fa54180e5802dcae2391bd276189030
BLAKE2b-256 d513e9b3098bcca7d2e13f91d80d1f0159e07cfbe558ae137216acdf21eb1832

See more details on using hashes here.

Provenance

The following attestation bundles were made for plycast-0.1.0.tar.gz:

Publisher: pypi-publish.yml on latoi-hub/plycast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plycast-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plycast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plycast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 275ac56c18fa0fbb63b24aa8351f96aa14e5de692e81cdb7be2c29be08495b3d
MD5 23e08aabd02e1e03335468d65f663159
BLAKE2b-256 a53187e5a5b4da9b9e18aff054a6cb5a593e39f21a939778994dcf3258f37ac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for plycast-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on latoi-hub/plycast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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