Skip to main content

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

  1. Go to https://translate-api.com
  2. Click "Login" or "Get Started"
  3. Create an account (it's free to start!)
  4. Go to your Dashboard
  5. Click "Create API Key"
  6. 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.com
  • base_url (optional): Custom API URL

translate(text, target_language)

Translate text to one or more languages.

Parameters:

  • text: The text you want to translate
  • target_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?

📝 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

translate_api_client-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translate_api_client-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for translate_api_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7c18dcce911023146d9466831b16aac5334a9f8d56fe9a3cb737a74d50f035fa
MD5 cddf79ba3b3887ec3381c8970441d9bd
BLAKE2b-256 0ea122e3c02f71b4cc6f92c81300521950206129765cdd52a8c316a0e4e7224e

See more details on using hashes here.

File details

Details for the file translate_api_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for translate_api_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74a820aea4ae48a545398b541eaac9821566333b4fba7bde79d18c4c1ef4ab6f
MD5 d2af2450833714944e281e5b18c08e9d
BLAKE2b-256 48a66b805e8766c037a16a0de0c06f02479b7c2e8d93ab4fa0a8b69b92557ce2

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