Skip to content

indravoyager/cypy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cypy

cypy Logo

cypy is a CLI manga translator using YOLOv8 to detect speech bubbles and the Google Gemini API to translate foreign text, keeping artwork clean and typography well-fitted.


Preview

Before (Original Page) After (Translated Page)
Original Manga Page Translated Indonesian Manga Page

Features

  • Multi-Language Support: Translate to English, Indonesian, Japanese (with native vertical Tategaki text!), Mandarin (简体中文), Spanish, Portuguese, Javanese, and Custom Languages (supports Thai, Arabic, Cyrillic, etc. with automatic full variable font downloading!).
  • Multi-Provider AI: Choose between Google Gemini, OpenAI (GPT-5.4), Zen (free, no key needed), OpenRouter (100+ models), or Custom (any OpenAI-compatible API) directly from the CLI.
  • Interactive Commands: Change the target language (lang), switch API providers (provider), change models (model), or check current settings (status) on the fly inside the loop.
  • Zero-Setup Startup: Prompts for the API key in the CLI and generates the .env file automatically if missing. Zen works out of the box — no API key required.
  • Custom API Support: Bring your own OpenAI-compatible endpoint with configurable base URL, API key, and model.
  • Auto Desktop Shortcut: Creates a rounded Windows desktop shortcut automatically on the first run.
  • Persistent Settings: Your preferences (active language, provider, models, and keys) are automatically saved to data/settings.json whenever they change, preserving your configuration across runs.
  • Dynamic Box Layouts: Terminal tables, guides, and status cards calculate width dynamically using East Asian Width rules, ensuring perfect column alignment even with CJK characters or long names.

Installation & Setup

Option 1: Standalone Release (Recommended)

Download the pre-compiled package for your OS from the Releases page.

  1. Download and extract the .zip file.
  2. Run the application:
    • Windows: Double-click cypy.exe inside the extracted folder. A desktop shortcut with the custom cypy icon will be automatically created on the first run!
    • Linux: Open a terminal in the extracted folder, make it executable, and run:
      chmod +x cypy
      ./cypy
    • macOS: Run ./cypy inside the extracted folder.
  3. Paste your Gemini API key when prompted on the first run.

Option 2: Run from Source (For Developers)

  1. Clone the repo:
    git clone https://github.com/indravoyager/cypy.git
    cd cypy
  2. Set up virtual environment:
    python -m venv venv
    # Activate:
    source venv/bin/activate  # Linux/macOS
    venv\Scripts\activate     # Windows (CMD)
  3. Install in editable mode:
    pip install -e .
  4. Run the application: Once installed, you can launch the app from any directory:
    cypy
    Or run it directly as a module from the project root:
    python -m cypy

Option 3: Building Standalone Executable (Using PyInstaller)

If you want to compile cypy into a standalone, optimized directory package yourself, run the build script:

python build.py

This requires PyInstaller (which will be installed automatically if missing) and will output the ready-to-run .zip package inside the releases/ directory.


Configuration

Customise settings inside the .env file:

# Gemini Config (Default)
GEMINI_API_KEY=your_gemini_api_key_here
MODEL_GEMINI=gemini-3.1-flash-lite

# OpenAI Config (Optional)
OPENAI_API_KEY=your_openai_api_key_here
MODEL_OPENAI=gpt-5.4-mini

# Zen (https://opencode.ai) — no API key required
ZEN_API_KEY=
MODEL_ZEN=minimax-m3-free

# OpenRouter Config (Optional)
OPENROUTER_API_KEY=your_openrouter_api_key_here
MODEL_OPENROUTER=qwen/qwen2.5-vl-72b-instruct:free

# Custom OpenAI-compatible provider
CUSTOM_BASE_URL=https://your-api.example.com/v1
CUSTOM_API_KEY=your_api_key_here
MODEL_CUSTOM=gpt-5.4-mini

[NOTE] Advanced layout settings (margins, font scales, etc.) can be adjusted in cypy/core/config.py.


Project Structure

cypy/
├── assets/              # YOLO model weights, font, and icons
├── cypy/                # Main Python package
│   ├── app.py           # Entrypoint loop & CLI logic
│   ├── __main__.py      # Module entrypoint for `python -m cypy`
│   └── core/            # Engine modules
│       ├── config.py
│       ├── translator.py
│       ├── utils.py
│       └── providers/   # LLM integrations
│           ├── base.py
│           ├── gemini.py
│           ├── openai_provider.py
│           ├── zen.py
│           ├── openrouter.py
│           └── custom.py
├── pyproject.toml       # Python package configuration
└── README.md

License

MIT

About

cypy ✦ Automated manga translation CLI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages