Skip to main content

fanyit

Install. Translate. Done.

Zero-config CLI tool for translating subtitles and documents. Works out of the box with no API keys or setup required.

Install

pip install fanyit

Quick Start

Translate a subtitle file - no engine flag needed:

fanyi subs movie.srt --target zh

That's it. Fanyi automatically finds a working translation engine or uses its built-in demo engine.

For real translations, run setup once:

fanyi setup

Quality Tiers

Choose your speed/quality tradeoff:

fanyi subs movie.srt --target zh --quality fast      # Draft quality, maximum speed
fanyi subs movie.srt --target zh --quality standard  # Everyday use (default)
fanyi subs movie.srt --target zh --quality best      # Publication quality, slower

Supported Formats

Format Extensions Description
SRT .srt SubRip subtitle format
ASS/SSA .ass, .ssa Advanced SubStation Alpha
VTT .vtt WebVTT subtitle format
Text .txt Plain text files
Markdown .md Markdown documents
PDF .pdf PDF documents (text extraction)
DOCX .docx Microsoft Word documents
Audio .mp3, .wav Audio transcription + translation

Advanced

Configuration File

Create ~/.fanyi.yaml or run fanyi setup:

engine: ollama
target_language: zh
ollama_host: http://localhost:11434
ollama_model: llama3

Environment Variables

export FANYI_ENGINE=openai
export FANYI_OPENAI_API_KEY=your-key
export FANYI_TARGET_LANGUAGE=zh

All Engines

Engine Description Requires API Key
OpenAI GPT-based translation Yes
DeepL Professional translation API Yes
Ollama Local LLM (private, offline) No
Mock Built-in demo engine No

All CLI Options

fanyi translate file.txt --engine openai --target zh --source en
fanyi translate file.txt --quality best --context-lines 5
fanyi translate ./docs/ --recursive --concurrency 4
fanyi translate file.txt --no-cache --resume --glossary terms.csv
fanyi subs movie.srt --target ja --quality fast
fanyi check          # Verify engine connectivity
fanyi config --show  # View current config
fanyi cache stats    # Cache statistics
fanyi jobs list      # View interrupted jobs

License

MIT

Metadata

Release files for fanyit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fanyit 0.2.0
File Size Uploaded Provenance Actions
fanyit-0.2.0.tar.gz 88.9 kB Without provenance Details for fanyit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fanyit 0.2.0
File Interpreter ABI Platform Actions
fanyit-0.2.0-py3-none-any.whl Python 3 none any Details for fanyit-0.2.0-py3-none-any.whl

Total release size: 153.3 kB

Release files / fanyit-0.2.0.tar.gz

Download URL fanyit-0.2.0.tar.gz
Size 88.9 kB
Tags Source
SHA-256 checksum
How to use checksums
96e513d7174fe671634ba1273a9022a5521406d691509d318903cb23d07f4099
BLAKE2b-256 checksum
How to use checksums
6e71ac7d4e7512f0425f06e2d4c0650f74120390b71f3bf3868988839b1591ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / fanyit-0.2.0-py3-none-any.whl

Download URL fanyit-0.2.0-py3-none-any.whl
Size 64.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65e31cea7db1763af414d2bca350648c2ff2fe272dea54615d0268483735dcf7
BLAKE2b-256 checksum
How to use checksums
dcf913822a094c0d6c524f92064f4170087fd3add88cabaac326f4eea86a4b54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for fanyit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page