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 keyAI_MODEL: AI model to use (default: gpt-4)AI_API_BASE: Custom API base URL
Examples
- Start the translator:
trans
- Enable debug mode:
trans --verbose
- Use a specific model:
trans --model gpt-3.5-turbo
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file y_translator_cli-0.1.3.tar.gz.
File metadata
- Download URL: y_translator_cli-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a683301c105adf1c9ec47ae4b27a84213d01a864e5578183fc374e1e7a23582a
|
|
| MD5 |
55ac87637b98c9c70dfec63400ede246
|
|
| BLAKE2b-256 |
767b207d93396a1d6f2b592973c4bac4cd6e0c78fb00e022435e3354b33ebecd
|
File details
Details for the file y_translator_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: y_translator_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a711e2231e5627db3dcf4c7349290fc0e4ab6f33bb9eec45a740cc6c9c5c9784
|
|
| MD5 |
8fd0b7054bc8ad73bb3c163279beb5f9
|
|
| BLAKE2b-256 |
903f661c1eed36881a0a1135f1a5b8d8698be4c40f94aa438cc36ebe772b254f
|