Skip to main content

An AI-powered English-Chinese translator for the command line

Project description

Y-Translator CLI

An AI-powered command-line translator that converts between English and Chinese.

Installation

pip install y-translator-cli

Usage

Start the translator:

y-translator

Options:

  • -h, --help: Show help message
  • -v, --version: Show version information
  • --verbose: Enable debug mode
  • --model MODEL: Specify AI model to use (default: gpt-4)
  • --api-key KEY: Set OpenAI API key
  • --api-base URL: Set custom API base URL
  • -n, --no-stream: Disable streaming mode

Environment Variables

You can set the following environment variables:

  • AI_API_KEY: Your OpenAI API key
  • AI_MODEL: AI model to use (default: gpt-4)
  • AI_API_BASE: Custom API base URL

Examples

  1. Start the translator:
y-translator
  1. Enable debug mode:
y-translator --verbose
  1. Use a specific model:
y-translator --model gpt-3.5-turbo
  1. Disable streaming output:
y-translator -n

Development

Installation for Development

# Clone the repository
git clone https://github.com/yourusername/y-translator.git
cd y-translator

# Install in development mode
pip install -e .

Building the Package

# Use build
python -m build

If building manually, you may want to clean old files first:

# Clean before building
rm -rf dist/ build/ *.egg-info/ __pycache__/ .pytest_cache/
find . -name "*.pyc" -delete

License

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

y_translator_cli-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

y_translator_cli-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: y_translator_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for y_translator_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90d0a35e2e622806199f3d76d8b7039af2d6e8853145627816ff7738b64d32d3
MD5 dde2904b4ac5a62d92a9711a494bd6d2
BLAKE2b-256 d3ebcc3b532a500b377c68ea31146faf305c6687b56e3fa8edc235544af23539

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for y_translator_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1bc511d2c14cc8c586b135b8c05e4e5aaed5d493d0b7946b5f355aaa0ae8d9c
MD5 cc1f715790841fbb954a6dd93a11cb5d
BLAKE2b-256 09c244b62211ade0056527f2eefab210b88b1ef68d94e934e4e0b91e33ab9d2b

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