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

Uploaded Python 3

File details

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

File metadata

  • Download URL: y_translator_cli-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 fa15729556bb46e67001428de5b4e901985603423c51a992d1052c40547f2166
MD5 488ecb66e1bb51a0900eb6a10f5b2545
BLAKE2b-256 f06f4c2c547fddb49663ef3fc61e4e4d1c4f0b625c795ef867466c8652a1ef33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for y_translator_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 befae06f056cd7fc1f8ade7f23bc28cdd057be762b9520c7a4c27ebd3c9f18d1
MD5 b4558afe6c86cc7e756a1db65cb0555d
BLAKE2b-256 3fdc90ce507fd1b17d47b218064e2cf64da50fb390a01d48b47ac2850a0f05c6

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