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.1.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.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: y_translator_cli-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 11fdaf5c220e3d530d919ece03d3aff80a5a8f29a645bd08b95735d83bbf4c08
MD5 389a1bbcf9f7a29c14a168bad52564af
BLAKE2b-256 dbe1f4426a6245ddfa571428ab176c8bef1f88258169e5c12f5a4adda69c3174

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for y_translator_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c3bc9a46cde568045167441176a82b82995902c6716ce14412329351c0647a0
MD5 8ad9d32dc7a0565cdb3f2ee5cb699b3f
BLAKE2b-256 940750ab63076760b87e4d28be972d10c41ee3de5f1adaef37423cf2a484f425

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