Skip to main content

capo-translate: typed, async Python SDK for AWS Translate

capo-translate is a typed Python SDK for AWS Translate. It has an async client, AsyncTranslateClient, for asyncio and trio, and a sync client, TranslateClient, with the same methods. Requests and responses are typed with TypedDicts, so your editor and type checker know every field.

It is part of capo, a community-driven alternative to boto3 and aioboto3, built on its own HTTP stack instead of botocore and generated from the official AWS Smithy models. Documentation: https://capo-sdk.dev/services/translate/

Installation

pip install capo-translate

Usage

from capo_translate import AsyncTranslateClient


async def main():
    async with AsyncTranslateClient() as translate:
        # Example: call the create_parallel_data operation
        response = await translate.create_parallel_data()
        print(response["name"])

Pagination

Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.

from capo_translate import AsyncTranslateClient


async def main():
    async with AsyncTranslateClient() as translate:
        # Example: paginate over list_languages
        async for item in translate.iter_list_languages():
            print(item)

Error Handling

The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.

from capo_translate import AsyncTranslateClient
from capo_translate.error import ConcurrentModificationException


async def main():
    async with AsyncTranslateClient() as translate:
        try:
            await translate.create_parallel_data()
        except ConcurrentModificationException as e:
            print(f"Error: {e}")
            print(e.data)  # additional error data

Retrying

The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.

The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.

from capo_translate import AsyncTranslateClient


async def main():
    async with AsyncTranslateClient() as translate:
        # Default: 3 attempts for every operation
        response = await translate.create_parallel_data()

        # Override per operation
        response = await translate.create_parallel_data(config_overrides={"retry_max_attempts": 5})

        # Disable retries for this call
        response = await translate.create_parallel_data(config_overrides={"retry_max_attempts": 1})

Metadata

Release files for capo-translate 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capo-translate 0.9.0
File Size Uploaded
capo_translate-0.9.0.tar.gz 106.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capo-translate 0.9.0
File Interpreter ABI Platform
capo_translate-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 304.3 kB

Release files / capo_translate-0.9.0.tar.gz

Download URL capo_translate-0.9.0.tar.gz
Size 106.5 kB
Tags Source
SHA-256 checksum
How to use checksums
15e9c1abc2a6e28da3640037edee83d9b9251a1bc4bd20f33291b452ca07f8bf
BLAKE2b-256 checksum
How to use checksums
3f49ada64d94c6aa77fd4087073b72b6b6143b6d07caef3797257e6225396a74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / capo_translate-0.9.0-py3-none-any.whl

Download URL capo_translate-0.9.0-py3-none-any.whl
Size 197.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1522237401c9c98e8e2342b96baf7014144b8447414e900d52fb7406ce0bdce0
BLAKE2b-256 checksum
How to use checksums
5ebff6332c4f276a56c41615be8b02e764a2208de77dee3b7cfd8674cfa6b433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page