Ingest text (txt/md/pdf/docx/images), translate, and synthesize audio.
Project description
plycast
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-langfor 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
plycast.providers— vendor code (HTTP clients, auth, translators, TTS), plusbaseprotocols,llm,translation_prompt.plycast.services—TranslateService,ReadTextService,AudioService(including static factory methods for wiring).plycast.pipelines— composed flows: read-only, read→translate, read→translate→audio, read→audio.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16027d7607406d68542be2bd0c7c4cfdfe25fcb52c3b20e0d229de0adbac31c0
|
|
| MD5 |
1fa54180e5802dcae2391bd276189030
|
|
| BLAKE2b-256 |
d513e9b3098bcca7d2e13f91d80d1f0159e07cfbe558ae137216acdf21eb1832
|
Provenance
The following attestation bundles were made for plycast-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on latoi-hub/plycast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plycast-0.1.0.tar.gz -
Subject digest:
16027d7607406d68542be2bd0c7c4cfdfe25fcb52c3b20e0d229de0adbac31c0 - Sigstore transparency entry: 1189447210
- Sigstore integration time:
-
Permalink:
latoi-hub/plycast@228fb8ff27e580a6dd277a7bc58e9c50741cc59d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/latoi-hub
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@228fb8ff27e580a6dd277a7bc58e9c50741cc59d -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
275ac56c18fa0fbb63b24aa8351f96aa14e5de692e81cdb7be2c29be08495b3d
|
|
| MD5 |
23e08aabd02e1e03335468d65f663159
|
|
| BLAKE2b-256 |
a53187e5a5b4da9b9e18aff054a6cb5a593e39f21a939778994dcf3258f37ac2
|
Provenance
The following attestation bundles were made for plycast-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on latoi-hub/plycast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plycast-0.1.0-py3-none-any.whl -
Subject digest:
275ac56c18fa0fbb63b24aa8351f96aa14e5de692e81cdb7be2c29be08495b3d - Sigstore transparency entry: 1189447216
- Sigstore integration time:
-
Permalink:
latoi-hub/plycast@228fb8ff27e580a6dd277a7bc58e9c50741cc59d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/latoi-hub
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@228fb8ff27e580a6dd277a7bc58e9c50741cc59d -
Trigger Event:
workflow_dispatch
-
Statement type: