Official Python SDK for Translate API
Project description
Translate API - Python SDK
Official Python SDK for Translate API.
🚀 Quick Start (For Beginners)
Step 1: Get Your API Key
- Go to https://translate-api.com
- Click "Login" or "Get Started"
- Create an account (it's free to start!)
- Go to your Dashboard
- Click "Create API Key"
- Copy your API key - you'll need it!
Step 2: Install the SDK
Open your terminal/command prompt and run:
pip install translate-api-client
Step 3: Use It!
from translate_api import TranslateAPI
# Replace 'your-api-key' with your actual API key from translate-api.com
client = TranslateAPI('your-api-key')
# Translate to one language
result = client.translate('Hello world', 'es')
print(result['translations']['es']) # Output: "Hola mundo"
# Translate to multiple languages at once
result = client.translate('Hello world', ['es', 'fr', 'de'])
print(result['translations'])
# Output: {'es': 'Hola mundo', 'fr': 'Bonjour le monde', 'de': 'Hallo Welt'}
📖 Full API Reference
Constructor
client = TranslateAPI(api_key, base_url='https://translate-api.com/v1')
api_key(required): Your API key from translate-api.combase_url(optional): Custom API URL
translate(text, target_language)
Translate text to one or more languages.
Parameters:
text: The text you want to translatetarget_language: A language code ('es') or list of codes (['es', 'fr'])
Returns: Dictionary with translation results
translate_batch(items)
Translate multiple texts at once.
results = client.translate_batch([
{'text': 'Hello', 'target_language': 'es'},
{'text': 'Goodbye', 'target_language': 'fr'}
])
🌍 Supported Languages
Visit translate-api.com/documentation for a full list.
Common codes: en, es, fr, de, it, pt, zh, ja, ko, ar
❓ Need Help?
- Documentation: translate-api.com/documentation
- Support: support@translate-api.com
📝 License
MIT License
Project details
Release history Release notifications | RSS feed
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 translate_api_client-1.0.0.tar.gz.
File metadata
- Download URL: translate_api_client-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c18dcce911023146d9466831b16aac5334a9f8d56fe9a3cb737a74d50f035fa
|
|
| MD5 |
cddf79ba3b3887ec3381c8970441d9bd
|
|
| BLAKE2b-256 |
0ea122e3c02f71b4cc6f92c81300521950206129765cdd52a8c316a0e4e7224e
|
File details
Details for the file translate_api_client-1.0.0-py3-none-any.whl.
File metadata
- Download URL: translate_api_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74a820aea4ae48a545398b541eaac9821566333b4fba7bde79d18c4c1ef4ab6f
|
|
| MD5 |
d2af2450833714944e281e5b18c08e9d
|
|
| BLAKE2b-256 |
48a66b805e8766c037a16a0de0c06f02479b7c2e8d93ab4fa0a8b69b92557ce2
|