accessibletranslator


Nameaccessibletranslator JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://www.accessibletranslator.com/resources/api-docs
SummaryAccessibleTranslator SDK API
upload_time2025-07-23 16:39:51
maintainerNone
docs_urlNone
authorOpenAPI Generator community
requires_python>=3.9
licenseNone
keywords openapi openapi-generator accessibletranslator sdk api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AccessibleTranslator Python SDK

Official Python SDK for AccessibleTranslator - automated cognitive accessibility and text simplification powered by Claude AI.

## What is AccessibleTranslator?

AccessibleTranslator transforms complex text into accessible formats for people with diverse cognitive needs. Our AI-powered platform offers 50+ specialized transformations to make content more understandable and cognitively accessible, while preserving meaning.

**Perfect for:**
- **API Partners**: Digital agencies, accessibility consultants, CMS plugin developers
- **Enterprise Clients**: Large businesses expanding accessibility at scale
- **Developers**: Building cognitively accessible applications and services
- **Organizations**: Going beyond compliance to reach cognitively diverse audiences

## Installation

```bash
pip install accessibletranslator
```

## Quick start

The AccessibleTranslator SDK uses async/await patterns for optimal performance when processing text. All API operations are asynchronous to handle the AI processing time efficiently.

### Basic setup

First, you'll need an API key from your AccessibleTranslator account. The SDK uses this key to authenticate all requests:

```python
import asyncio
import accessibletranslator
from accessibletranslator.rest import ApiException

# Configure API key authentication
configuration = accessibletranslator.Configuration(
    api_key={'ApiKeyAuth': 'sk_your_api_key_here'}
)

async def main():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        # Create API instances
        translation_api = accessibletranslator.TranslationApi(api_client)
        user_api = accessibletranslator.UserManagementApi(api_client)
        
        # Your code here
        pass

# Run async function
asyncio.run(main())
```

### Simple text translation

This example shows the core functionality: transforming complex text into more accessible versions. We're using two basic transformations that work well together:

```python
async def translate_text():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        
        # Create translation request
        request = accessibletranslator.TranslationRequest(
            text="The implementation of this algorithm requires substantial computational resources and exhibits significant complexity in its operational parameters.",
            transformations=["language_simple_sentences", "language_common_words"]
        )
        
        try:
            # Translate text
            result = await translation_api.translate(request)
            print(f"Original: {request.text}")
            print(f"Simplified: {result.translated_text}")
            print(f"Words used: {result.words_used}")
            print(f"Remaining balance: {result.word_balance}")
            
        except ApiException as e:
            print(f"Translation failed: {e}")

asyncio.run(translate_text())
```

## Discovery and exploration

AccessibleTranslator offers 50+ transformations that are continuously being improved and expanded. Rather than maintaining hardcoded lists in your application, the SDK provides methods to discover current options dynamically.

### Get available transformations

This approach ensures your application always has access to the latest transformations and their descriptions. The API returns both regular transformations and special functions (like `explain_changes`):

```python
async def explore_transformations():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        
        try:
            # Get all available transformations
            transformations_response = await translation_api.transformations()
            
            print(f"Available transformations ({transformations_response.total_transformations}):")
            for transform in transformations_response.transformations:
                print(f"  • {transform.name}: {transform.description}")
            
            # Show special functions too
            print(f"\nSpecial functions ({transformations_response.total_functions}):")
            for func in transformations_response.functions:
                print(f"  • {func.name}: {func.description}")
                
        except ApiException as e:
            print(f"Failed to get transformations: {e}")

asyncio.run(explore_transformations())
```

### Get supported languages

AccessibleTranslator can output simplified text in multiple languages. This is particularly useful for international organizations or multilingual content platforms:

```python
async def explore_languages():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        
        try:
            # Get supported target languages
            languages_response = await translation_api.target_languages()
            
            print(f"Supported languages ({languages_response.total_languages}):")
            for language in languages_response.languages:
                print(f"  • {language}")
            
            print(f"\nNote: {languages_response.usage_note}")
            
        except ApiException as e:
            print(f"Failed to get languages: {e}")

asyncio.run(explore_languages())
```

## Comprehensive examples

These examples demonstrate real-world scenarios where AccessibleTranslator adds significant value to applications and content workflows.

### Multi-language workflow

For international organizations, this pattern shows how to create accessible content in multiple languages. This is particularly valuable for global companies ensuring their content reaches cognitively diverse audiences worldwide:

```python
async def multilingual_accessibility():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        
     	# Define target languages
        target_languages = ["English", "Spanish", "French", "German", "Dutch"]  # Get from  translation_api.target_languages()
        
        original_text = "The implementation of this algorithm requires substantial computational resources and exhibits significant complexity in its operational parameters."
        transformations = ["language_simple_sentences", "language_common_words"]
        
        print("=== MULTILINGUAL ACCESSIBILITY ===")
        print(f"Original: {original_text}")
        
        for language in target_languages:
            if language in languages_response.languages:
                request = accessibletranslator.TranslationRequest(
                    text=original_text,
                    transformations=transformations,
                    target_language=language
                )
                
                try:
                    result = await translation_api.translate(request)
                    print(f"\n{language}: {result.translated_text}")
                    
                except ApiException as e:
                    print(f"\n{language}: Translation failed - {e}")

asyncio.run(multilingual_accessibility())
```

### Batch processing

When you need to process multiple texts (like articles, documentation, or user-generated content), this pattern shows how to handle batch operations efficiently while monitoring your word balance and handling individual failures gracefully:

```python
async def batch_translation():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        user_api = accessibletranslator.UserManagementApi(api_client)
        
        # Check initial word balance
        balance = await user_api.word_balance()
        print(f"Starting word balance: {balance.word_balance}")
        
        texts_to_process = [
            "The implementation requires careful consideration of edge cases.",
            "This methodology demonstrates significant improvements in efficacy.",
            "The comprehensive analysis reveals important correlations."
        ]
        
        transformations = ["language_simple_sentences", "language_common_words"]
        results = []
        
        for i, text in enumerate(texts_to_process, 1):
            print(f"\nProcessing text {i}/{len(texts_to_process)}...")
            
            request = accessibletranslator.TranslationRequest(
                text=text,
                transformations=transformations
            )
            
            try:
                result = await translation_api.translate(request)
                results.append({
                    'original': text,
                    'simplified': result.translated_text,
                    'words_used': result.words_used
                })
                
                print(f"✅ Processed ({result.words_used} words)")
                
            except ApiException as e:
                print(f"❌ Failed: {e}")
                results.append({
                    'original': text,
                    'error': str(e)
                })
        
        # Summary
        total_words_used = sum(r.get('words_used', 0) for r in results)
        successful = sum(1 for r in results if 'simplified' in r)
        
        print(f"\n=== BATCH PROCESSING SUMMARY ===")
        print(f"Processed: {successful}/{len(texts_to_process)} texts")
        print(f"Total words used: {total_words_used}")
        
        for i, result in enumerate(results, 1):
            print(f"\n--- Text {i} ---")
            print(f"Original: {result['original']}")
            if 'simplified' in result:
                print(f"Simplified: {result['simplified']}")
            else:
                print(f"Error: {result['error']}")

asyncio.run(batch_translation())
```

## Account management

AccessibleTranslator uses a word-based billing system. Each API call consumes words from your account balance based on the input text length. Monitoring your usage helps ensure uninterrupted service.

### Check word balance

Regularly checking your word balance helps you monitor usage and avoid service interruptions. This is especially important for production applications:

```python
async def check_balance():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        user_api = accessibletranslator.UserManagementApi(api_client)
        
        try:
            balance = await user_api.word_balance()
            print(f"Current word balance: {balance.word_balance:,} words")
            
        except ApiException as e:
            print(f"Failed to get balance: {e}")

asyncio.run(check_balance())
```

### System health check

For production applications, monitoring the API's availability ensures your accessibility features remain functional. This endpoint provides a quick way to verify system status:

```python
async def health_check():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        system_api = accessibletranslator.SystemApi(api_client)
        
        try:
            health = await system_api.check()
            print(f"System status: {health.status}")
            print(f"Timestamp: {health.timestamp}")
            
        except ApiException as e:
            print(f"Health check failed: {e}")

asyncio.run(health_check())
```

## Error handling

Robust error handling is crucial when integrating AI-powered accessibility features into production applications. Different error types require different response strategies.

### Comprehensive error handling

This example shows a production-ready approach to handling various error conditions you might encounter. The retry logic helps handle temporary issues while respecting different types of permanent failures:

```python
async def robust_translation():
    async with accessibletranslator.ApiClient(configuration) as api_client:
        translation_api = accessibletranslator.TranslationApi(api_client)
        user_api = accessibletranslator.UserManagementApi(api_client)
        
        # Pre-flight checks
        try:
            balance = await user_api.word_balance()
            if balance.word_balance < 100:
                print("⚠️  Warning: Low word balance")
        except ApiException:
            print("⚠️  Could not check word balance")
        
        # Translation with retry logic
        max_retries = 3
        retry_count = 0
        
        request = accessibletranslator.TranslationRequest(
            text="Your text here",
            transformations=["language_simple_sentences"]
        )
        
        while retry_count < max_retries:
            try:
                result = await translation_api.translate(request)
                print(f"✅ Translation successful!")
                print(f"Result: {result.translated_text}")
                break
                
            except ApiException as e:
                retry_count += 1
                print(f"❌ Attempt {retry_count} failed: {e}")
                
                if e.status == 402:  # Payment required
                    print("💳 Insufficient word balance")
                    break
                elif e.status == 401:  # Unauthorized
                    print("🔑 Invalid API key")
                    break
                elif e.status == 422:  # Validation error
                    print("📝 Invalid request format")
                    break
                elif retry_count < max_retries:
                    print(f"🔄 Retrying in 2 seconds...")
                    await asyncio.sleep(2)
                else:
                    print("💥 Max retries exceeded")

asyncio.run(robust_translation())
```

## API classes and methods

The SDK organizes functionality into logical API classes. Each class handles a specific aspect of the AccessibleTranslator service.

### TranslationApi

This is the primary class you'll use for text processing and discovery. It handles all transformation operations and provides methods to explore available options.

**Main translation functionality:**

- `translate(translation_request)` - Transform text with accessibility features
- `transformations()` - Get all available transformations and descriptions  
- `target_languages()` - Get supported output languages

### UserManagementApi

Manages account-level operations like checking your word balance. Essential for monitoring usage in production applications.

**Account and usage management:**

- `word_balance()` - Check remaining word balance

### SystemApi

Provides system status information for monitoring and health checks in production environments.

**System monitoring:**

- `check()` - Basic system health status

## Configuration options

The SDK supports various configuration options to adapt to different deployment environments and requirements.

### Authentication

API key authentication is the recommended approach for production applications. Store your API key securely (environment variables, secret management systems):

```python
# API Key authentication (recommended for production)
configuration = accessibletranslator.Configuration(
    api_key={'ApiKeyAuth': 'sk_your_api_key_here'}
)
```

### Advanced configuration

For production deployments, you may need to adjust connection settings, SSL configuration, or enable debug logging:

```python
configuration = accessibletranslator.Configuration(
    api_key={'ApiKeyAuth': 'sk_your_api_key_here'},
    # Connection settings
    connection_pool_maxsize=100,
    retries=3,
    # SSL settings
    verify_ssl=True,
    # Debug mode
    debug=False
)
```

## Best practices

These patterns help ensure reliable, maintainable integrations that scale well in production environments.

### 1. Use dynamic discovery

Transformations and languages are continuously updated. Dynamic discovery ensures your application always uses current options without requiring code updates:

```python
# Dynamic discovery
transformations = await translation_api.transformations()
languages = await translation_api.target_languages()
```

### 2. Handle async properly

Proper async context management prevents resource leaks and ensures connections are properly closed:

```python
# ✅ Good - Proper async context management
async with accessibletranslator.ApiClient(configuration) as api_client:
    api = accessibletranslator.TranslationApi(api_client)
    result = await api.translate(request)

# ❌ Avoid - Missing async context
api_client = accessibletranslator.ApiClient(configuration)
api = accessibletranslator.TranslationApi(api_client)
```

### 3. Monitor usage

Proactive monitoring prevents service interruptions and helps with capacity planning:

```python
# Check balance before large operations
balance = await user_api.word_balance()
if balance.word_balance < estimated_words_needed:
    print("Warning: Insufficient balance for operation")
```

### 4. Error recovery

Different error types require different handling strategies. Understanding these patterns improves application reliability:

```python
try:
    result = await translation_api.translate(request)
except ApiException as e:
    if e.status == 402:
        handle_insufficient_balance()
    elif e.status == 429:
        await asyncio.sleep(retry_delay)
        # Retry logic
```

## Getting help

- **API documentation**: [https://www.accessibletranslator.com/resources/api-docs](https://www.accessibletranslator.com/resources/api-docs)
- **Support**: support@accessibletranslator.com
- **Website**: [https://accessibletranslator.com](https://accessibletranslator.com)

---

## Technical details

**Requirements:** Python 3.9+

**Dependencies:** urllib3, python-dateutil, aiohttp, aiohttp-retry, pydantic, typing-extensions

**License:** MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.accessibletranslator.com/resources/api-docs",
    "name": "accessibletranslator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "OpenAPI, OpenAPI-Generator, AccessibleTranslator SDK API",
    "author": "OpenAPI Generator community",
    "author_email": "OpenAPI Generator Community <team@openapitools.org>",
    "download_url": "https://files.pythonhosted.org/packages/8c/8d/ae0aa348570c74317dde200d659b741ea12ae1957f297855b11e62dd0494/accessibletranslator-1.1.2.tar.gz",
    "platform": null,
    "description": "# AccessibleTranslator Python SDK\n\nOfficial Python SDK for AccessibleTranslator - automated cognitive accessibility and text simplification powered by Claude AI.\n\n## What is AccessibleTranslator?\n\nAccessibleTranslator transforms complex text into accessible formats for people with diverse cognitive needs. Our AI-powered platform offers 50+ specialized transformations to make content more understandable and cognitively accessible, while preserving meaning.\n\n**Perfect for:**\n- **API Partners**: Digital agencies, accessibility consultants, CMS plugin developers\n- **Enterprise Clients**: Large businesses expanding accessibility at scale\n- **Developers**: Building cognitively accessible applications and services\n- **Organizations**: Going beyond compliance to reach cognitively diverse audiences\n\n## Installation\n\n```bash\npip install accessibletranslator\n```\n\n## Quick start\n\nThe AccessibleTranslator SDK uses async/await patterns for optimal performance when processing text. All API operations are asynchronous to handle the AI processing time efficiently.\n\n### Basic setup\n\nFirst, you'll need an API key from your AccessibleTranslator account. The SDK uses this key to authenticate all requests:\n\n```python\nimport asyncio\nimport accessibletranslator\nfrom accessibletranslator.rest import ApiException\n\n# Configure API key authentication\nconfiguration = accessibletranslator.Configuration(\n    api_key={'ApiKeyAuth': 'sk_your_api_key_here'}\n)\n\nasync def main():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        # Create API instances\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        user_api = accessibletranslator.UserManagementApi(api_client)\n        \n        # Your code here\n        pass\n\n# Run async function\nasyncio.run(main())\n```\n\n### Simple text translation\n\nThis example shows the core functionality: transforming complex text into more accessible versions. We're using two basic transformations that work well together:\n\n```python\nasync def translate_text():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        \n        # Create translation request\n        request = accessibletranslator.TranslationRequest(\n            text=\"The implementation of this algorithm requires substantial computational resources and exhibits significant complexity in its operational parameters.\",\n            transformations=[\"language_simple_sentences\", \"language_common_words\"]\n        )\n        \n        try:\n            # Translate text\n            result = await translation_api.translate(request)\n            print(f\"Original: {request.text}\")\n            print(f\"Simplified: {result.translated_text}\")\n            print(f\"Words used: {result.words_used}\")\n            print(f\"Remaining balance: {result.word_balance}\")\n            \n        except ApiException as e:\n            print(f\"Translation failed: {e}\")\n\nasyncio.run(translate_text())\n```\n\n## Discovery and exploration\n\nAccessibleTranslator offers 50+ transformations that are continuously being improved and expanded. Rather than maintaining hardcoded lists in your application, the SDK provides methods to discover current options dynamically.\n\n### Get available transformations\n\nThis approach ensures your application always has access to the latest transformations and their descriptions. The API returns both regular transformations and special functions (like `explain_changes`):\n\n```python\nasync def explore_transformations():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        \n        try:\n            # Get all available transformations\n            transformations_response = await translation_api.transformations()\n            \n            print(f\"Available transformations ({transformations_response.total_transformations}):\")\n            for transform in transformations_response.transformations:\n                print(f\"  \u2022 {transform.name}: {transform.description}\")\n            \n            # Show special functions too\n            print(f\"\\nSpecial functions ({transformations_response.total_functions}):\")\n            for func in transformations_response.functions:\n                print(f\"  \u2022 {func.name}: {func.description}\")\n                \n        except ApiException as e:\n            print(f\"Failed to get transformations: {e}\")\n\nasyncio.run(explore_transformations())\n```\n\n### Get supported languages\n\nAccessibleTranslator can output simplified text in multiple languages. This is particularly useful for international organizations or multilingual content platforms:\n\n```python\nasync def explore_languages():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        \n        try:\n            # Get supported target languages\n            languages_response = await translation_api.target_languages()\n            \n            print(f\"Supported languages ({languages_response.total_languages}):\")\n            for language in languages_response.languages:\n                print(f\"  \u2022 {language}\")\n            \n            print(f\"\\nNote: {languages_response.usage_note}\")\n            \n        except ApiException as e:\n            print(f\"Failed to get languages: {e}\")\n\nasyncio.run(explore_languages())\n```\n\n## Comprehensive examples\n\nThese examples demonstrate real-world scenarios where AccessibleTranslator adds significant value to applications and content workflows.\n\n### Multi-language workflow\n\nFor international organizations, this pattern shows how to create accessible content in multiple languages. This is particularly valuable for global companies ensuring their content reaches cognitively diverse audiences worldwide:\n\n```python\nasync def multilingual_accessibility():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        \n     \t# Define target languages\n        target_languages = [\"English\", \"Spanish\", \"French\", \"German\", \"Dutch\"]  # Get from  translation_api.target_languages()\n        \n        original_text = \"The implementation of this algorithm requires substantial computational resources and exhibits significant complexity in its operational parameters.\"\n        transformations = [\"language_simple_sentences\", \"language_common_words\"]\n        \n        print(\"=== MULTILINGUAL ACCESSIBILITY ===\")\n        print(f\"Original: {original_text}\")\n        \n        for language in target_languages:\n            if language in languages_response.languages:\n                request = accessibletranslator.TranslationRequest(\n                    text=original_text,\n                    transformations=transformations,\n                    target_language=language\n                )\n                \n                try:\n                    result = await translation_api.translate(request)\n                    print(f\"\\n{language}: {result.translated_text}\")\n                    \n                except ApiException as e:\n                    print(f\"\\n{language}: Translation failed - {e}\")\n\nasyncio.run(multilingual_accessibility())\n```\n\n### Batch processing\n\nWhen you need to process multiple texts (like articles, documentation, or user-generated content), this pattern shows how to handle batch operations efficiently while monitoring your word balance and handling individual failures gracefully:\n\n```python\nasync def batch_translation():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        user_api = accessibletranslator.UserManagementApi(api_client)\n        \n        # Check initial word balance\n        balance = await user_api.word_balance()\n        print(f\"Starting word balance: {balance.word_balance}\")\n        \n        texts_to_process = [\n            \"The implementation requires careful consideration of edge cases.\",\n            \"This methodology demonstrates significant improvements in efficacy.\",\n            \"The comprehensive analysis reveals important correlations.\"\n        ]\n        \n        transformations = [\"language_simple_sentences\", \"language_common_words\"]\n        results = []\n        \n        for i, text in enumerate(texts_to_process, 1):\n            print(f\"\\nProcessing text {i}/{len(texts_to_process)}...\")\n            \n            request = accessibletranslator.TranslationRequest(\n                text=text,\n                transformations=transformations\n            )\n            \n            try:\n                result = await translation_api.translate(request)\n                results.append({\n                    'original': text,\n                    'simplified': result.translated_text,\n                    'words_used': result.words_used\n                })\n                \n                print(f\"\u2705 Processed ({result.words_used} words)\")\n                \n            except ApiException as e:\n                print(f\"\u274c Failed: {e}\")\n                results.append({\n                    'original': text,\n                    'error': str(e)\n                })\n        \n        # Summary\n        total_words_used = sum(r.get('words_used', 0) for r in results)\n        successful = sum(1 for r in results if 'simplified' in r)\n        \n        print(f\"\\n=== BATCH PROCESSING SUMMARY ===\")\n        print(f\"Processed: {successful}/{len(texts_to_process)} texts\")\n        print(f\"Total words used: {total_words_used}\")\n        \n        for i, result in enumerate(results, 1):\n            print(f\"\\n--- Text {i} ---\")\n            print(f\"Original: {result['original']}\")\n            if 'simplified' in result:\n                print(f\"Simplified: {result['simplified']}\")\n            else:\n                print(f\"Error: {result['error']}\")\n\nasyncio.run(batch_translation())\n```\n\n## Account management\n\nAccessibleTranslator uses a word-based billing system. Each API call consumes words from your account balance based on the input text length. Monitoring your usage helps ensure uninterrupted service.\n\n### Check word balance\n\nRegularly checking your word balance helps you monitor usage and avoid service interruptions. This is especially important for production applications:\n\n```python\nasync def check_balance():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        user_api = accessibletranslator.UserManagementApi(api_client)\n        \n        try:\n            balance = await user_api.word_balance()\n            print(f\"Current word balance: {balance.word_balance:,} words\")\n            \n        except ApiException as e:\n            print(f\"Failed to get balance: {e}\")\n\nasyncio.run(check_balance())\n```\n\n### System health check\n\nFor production applications, monitoring the API's availability ensures your accessibility features remain functional. This endpoint provides a quick way to verify system status:\n\n```python\nasync def health_check():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        system_api = accessibletranslator.SystemApi(api_client)\n        \n        try:\n            health = await system_api.check()\n            print(f\"System status: {health.status}\")\n            print(f\"Timestamp: {health.timestamp}\")\n            \n        except ApiException as e:\n            print(f\"Health check failed: {e}\")\n\nasyncio.run(health_check())\n```\n\n## Error handling\n\nRobust error handling is crucial when integrating AI-powered accessibility features into production applications. Different error types require different response strategies.\n\n### Comprehensive error handling\n\nThis example shows a production-ready approach to handling various error conditions you might encounter. The retry logic helps handle temporary issues while respecting different types of permanent failures:\n\n```python\nasync def robust_translation():\n    async with accessibletranslator.ApiClient(configuration) as api_client:\n        translation_api = accessibletranslator.TranslationApi(api_client)\n        user_api = accessibletranslator.UserManagementApi(api_client)\n        \n        # Pre-flight checks\n        try:\n            balance = await user_api.word_balance()\n            if balance.word_balance < 100:\n                print(\"\u26a0\ufe0f  Warning: Low word balance\")\n        except ApiException:\n            print(\"\u26a0\ufe0f  Could not check word balance\")\n        \n        # Translation with retry logic\n        max_retries = 3\n        retry_count = 0\n        \n        request = accessibletranslator.TranslationRequest(\n            text=\"Your text here\",\n            transformations=[\"language_simple_sentences\"]\n        )\n        \n        while retry_count < max_retries:\n            try:\n                result = await translation_api.translate(request)\n                print(f\"\u2705 Translation successful!\")\n                print(f\"Result: {result.translated_text}\")\n                break\n                \n            except ApiException as e:\n                retry_count += 1\n                print(f\"\u274c Attempt {retry_count} failed: {e}\")\n                \n                if e.status == 402:  # Payment required\n                    print(\"\ud83d\udcb3 Insufficient word balance\")\n                    break\n                elif e.status == 401:  # Unauthorized\n                    print(\"\ud83d\udd11 Invalid API key\")\n                    break\n                elif e.status == 422:  # Validation error\n                    print(\"\ud83d\udcdd Invalid request format\")\n                    break\n                elif retry_count < max_retries:\n                    print(f\"\ud83d\udd04 Retrying in 2 seconds...\")\n                    await asyncio.sleep(2)\n                else:\n                    print(\"\ud83d\udca5 Max retries exceeded\")\n\nasyncio.run(robust_translation())\n```\n\n## API classes and methods\n\nThe SDK organizes functionality into logical API classes. Each class handles a specific aspect of the AccessibleTranslator service.\n\n### TranslationApi\n\nThis is the primary class you'll use for text processing and discovery. It handles all transformation operations and provides methods to explore available options.\n\n**Main translation functionality:**\n\n- `translate(translation_request)` - Transform text with accessibility features\n- `transformations()` - Get all available transformations and descriptions  \n- `target_languages()` - Get supported output languages\n\n### UserManagementApi\n\nManages account-level operations like checking your word balance. Essential for monitoring usage in production applications.\n\n**Account and usage management:**\n\n- `word_balance()` - Check remaining word balance\n\n### SystemApi\n\nProvides system status information for monitoring and health checks in production environments.\n\n**System monitoring:**\n\n- `check()` - Basic system health status\n\n## Configuration options\n\nThe SDK supports various configuration options to adapt to different deployment environments and requirements.\n\n### Authentication\n\nAPI key authentication is the recommended approach for production applications. Store your API key securely (environment variables, secret management systems):\n\n```python\n# API Key authentication (recommended for production)\nconfiguration = accessibletranslator.Configuration(\n    api_key={'ApiKeyAuth': 'sk_your_api_key_here'}\n)\n```\n\n### Advanced configuration\n\nFor production deployments, you may need to adjust connection settings, SSL configuration, or enable debug logging:\n\n```python\nconfiguration = accessibletranslator.Configuration(\n    api_key={'ApiKeyAuth': 'sk_your_api_key_here'},\n    # Connection settings\n    connection_pool_maxsize=100,\n    retries=3,\n    # SSL settings\n    verify_ssl=True,\n    # Debug mode\n    debug=False\n)\n```\n\n## Best practices\n\nThese patterns help ensure reliable, maintainable integrations that scale well in production environments.\n\n### 1. Use dynamic discovery\n\nTransformations and languages are continuously updated. Dynamic discovery ensures your application always uses current options without requiring code updates:\n\n```python\n# Dynamic discovery\ntransformations = await translation_api.transformations()\nlanguages = await translation_api.target_languages()\n```\n\n### 2. Handle async properly\n\nProper async context management prevents resource leaks and ensures connections are properly closed:\n\n```python\n# \u2705 Good - Proper async context management\nasync with accessibletranslator.ApiClient(configuration) as api_client:\n    api = accessibletranslator.TranslationApi(api_client)\n    result = await api.translate(request)\n\n# \u274c Avoid - Missing async context\napi_client = accessibletranslator.ApiClient(configuration)\napi = accessibletranslator.TranslationApi(api_client)\n```\n\n### 3. Monitor usage\n\nProactive monitoring prevents service interruptions and helps with capacity planning:\n\n```python\n# Check balance before large operations\nbalance = await user_api.word_balance()\nif balance.word_balance < estimated_words_needed:\n    print(\"Warning: Insufficient balance for operation\")\n```\n\n### 4. Error recovery\n\nDifferent error types require different handling strategies. Understanding these patterns improves application reliability:\n\n```python\ntry:\n    result = await translation_api.translate(request)\nexcept ApiException as e:\n    if e.status == 402:\n        handle_insufficient_balance()\n    elif e.status == 429:\n        await asyncio.sleep(retry_delay)\n        # Retry logic\n```\n\n## Getting help\n\n- **API documentation**: [https://www.accessibletranslator.com/resources/api-docs](https://www.accessibletranslator.com/resources/api-docs)\n- **Support**: support@accessibletranslator.com\n- **Website**: [https://accessibletranslator.com](https://accessibletranslator.com)\n\n---\n\n## Technical details\n\n**Requirements:** Python 3.9+\n\n**Dependencies:** urllib3, python-dateutil, aiohttp, aiohttp-retry, pydantic, typing-extensions\n\n**License:** MIT\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AccessibleTranslator SDK API",
    "version": "1.1.2",
    "project_urls": {
        "Homepage": "https://www.accessibletranslator.com/resources/api-docs",
        "Repository": "https://github.com/GIT_USER_ID/GIT_REPO_ID"
    },
    "split_keywords": [
        "openapi",
        " openapi-generator",
        " accessibletranslator sdk api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c376a1f5fdf93ab7eb29664d26b5f7f183d966cd32ef0bd2f3b522f9feb32d32",
                "md5": "68beff0286c5ef3f9fcb1004dc349eeb",
                "sha256": "00461787ae16f0fc87fce5f1241763d5bb8f7f77f2e644a5817be60f40a18d85"
            },
            "downloads": -1,
            "filename": "accessibletranslator-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "68beff0286c5ef3f9fcb1004dc349eeb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 50078,
            "upload_time": "2025-07-23T16:39:50",
            "upload_time_iso_8601": "2025-07-23T16:39:50.976714Z",
            "url": "https://files.pythonhosted.org/packages/c3/76/a1f5fdf93ab7eb29664d26b5f7f183d966cd32ef0bd2f3b522f9feb32d32/accessibletranslator-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8c8dae0aa348570c74317dde200d659b741ea12ae1957f297855b11e62dd0494",
                "md5": "6448bba8db9c58e4ec69803a85f27f86",
                "sha256": "c0e57777e9123fc6222be153d3b5b86ab822730e26c27d0dbc12cf1e8afad098"
            },
            "downloads": -1,
            "filename": "accessibletranslator-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6448bba8db9c58e4ec69803a85f27f86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 37814,
            "upload_time": "2025-07-23T16:39:51",
            "upload_time_iso_8601": "2025-07-23T16:39:51.878306Z",
            "url": "https://files.pythonhosted.org/packages/8c/8d/ae0aa348570c74317dde200d659b741ea12ae1957f297855b11e62dd0494/accessibletranslator-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-23 16:39:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GIT_USER_ID",
    "github_project": "GIT_REPO_ID",
    "github_not_found": true,
    "lcname": "accessibletranslator"
}
        
Elapsed time: 0.44947s