Skip to main content

Getting Started

Installation

pip install capo-device-farm

Usage

from capo_device_farm import AsyncDeviceFarmClient


async def main():
    async with AsyncDeviceFarmClient() as device_farm:
        # Example: call the create_device_pool operation
        response = await device_farm.create_device_pool()
        print(response["device_pool"])

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_device_farm import AsyncDeviceFarmClient


async def main():
    async with AsyncDeviceFarmClient() as device_farm:
        # Example: paginate over get_offering_status
        async for item in device_farm.iter_get_offering_status():
            print(item)

Error Handling

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

from capo_device_farm import AsyncDeviceFarmClient
from capo_device_farm.error import ArgumentException


async def main():
    async with AsyncDeviceFarmClient() as device_farm:
        try:
            await device_farm.create_device_pool()
        except ArgumentException 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_device_farm import AsyncDeviceFarmClient


async def main():
    async with AsyncDeviceFarmClient() as device_farm:
        # Default: 3 attempts for every operation
        response = await device_farm.create_device_pool()

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

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

Release files for capo-device-farm 0.1.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-device-farm 0.1.0
File Size Uploaded
capo_device_farm-0.1.0.tar.gz 178.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capo-device-farm 0.1.0
File Interpreter ABI Platform
capo_device_farm-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 657.8 kB

Release files / capo_device_farm-0.1.0.tar.gz

Download URL capo_device_farm-0.1.0.tar.gz
Size 178.5 kB
Tags Source
SHA-256 checksum
How to use checksums
66ad1daa4dc8e57f7386e0882e1b4cc12c94cbe13fa920ef7c4b2ad586ea0121
BLAKE2b-256 checksum
How to use checksums
9f923a3dadacfc5d0cde5d89720932119850a310567b8393cd7bbfe124df6871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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_device_farm-0.1.0-py3-none-any.whl

Download URL capo_device_farm-0.1.0-py3-none-any.whl
Size 479.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9899ead7899ad5c0aa17564dd2936043929a4ecaea34b638ab4107deefb502f
BLAKE2b-256 checksum
How to use checksums
d742b7ad7ebe60b899c70321f9f44c5927fd2be02f4b935c1f0acd6ab078f450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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.1.0 This release

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