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:

trans

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:
trans
  1. Enable debug mode:
trans --verbose
  1. Use a specific model:
trans --model gpt-3.5-turbo
  1. Disable streaming output:
trans -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.4.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.4-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for y_translator_cli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e452483bae6d637f240e4d42506b17b9642524a621f90f74496be2545deb223e
MD5 ff6f3a6a0aa2178aeed7a610d0d0c6f2
BLAKE2b-256 cf73e43cef8c5daefc7fab3ec72692504e66b5ecafba07e6ff43ee321f9bf8fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for y_translator_cli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 09851746c2444ccc82034968168b62ef64acef74fc59f72e72305d881b86a069
MD5 57a992f4625ab4e9dc3b28aa1531b976
BLAKE2b-256 81fd7f68087cc0a1abb011fd9b2debdf051bcf993e7efdf6da4ba85fe8bc44f3

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