Install & Compatibility
Where this runs
tested against v1.43.78 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.636s · 52.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.606s · 53MB
51MB installed
● package 51MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DeviceFarmClient
✓ from mypy_boto3_devicefarm.client import DeviceFarmClient
The primary type hint for the boto3 DeviceFarm client.
DeviceFarmServiceName
✓ from mypy_boto3_devicefarm.literals import DeviceFarmServiceName
Type hint for the literal service name string, useful for `boto3.client()` calls.
ListDevicesResponseTypeDef
✓ from mypy_boto3_devicefarm.type_defs import ListDevicesResponseTypeDef
An example TypedDict for the response structure of a DeviceFarm API call.
This quickstart demonstrates how to obtain a type-hinted `boto3` DeviceFarm client and use it to call `list_devices`. It includes conditional type imports (`if TYPE_CHECKING`) for clean runtime behavior and shows how to type-hint both the client object and API call responses. Remember to configure your AWS credentials and region, as Device Farm is a region-specific service.
import os
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_devicefarm.client import DeviceFarmClient
from mypy_boto3_devicefarm.type_defs import ListDevicesResponseTypeDef
def get_devicefarm_client() -> 'DeviceFarmClient':
"""Returns a type-hinted boto3 DeviceFarm client."""
# Ensure AWS credentials are available via environment variables or other boto3 config
# e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
session = boto3.Session(
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),
region_name=os.environ.get('AWS_REGION', 'us-west-2') # Device Farm is region-specific
)
client: DeviceFarmClient = session.client('devicefarm')
return client
def list_devicefarm_devices():
"""Lists available Device Farm devices with type hints."""
client = get_devicefarm_client()
print("Attempting to list Device Farm devices...")
try:
response: ListDevicesResponseTypeDef = client.list_devices(filters=[{'attribute': 'PLATFORM', 'operator': 'EQUALS', 'values': ['ANDROID']}])
devices = response.get('devices', [])
if devices:
print(f"Found {len(devices)} Android devices:")
for device in devices:
print(f" - {device.get('name')} (ARN: {device.get('arn')})")
else:
print("No Android devices found.")
except client.exceptions.ServiceException as e:
print(f"AWS Service Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
if __name__ == '__main__':
list_devicefarm_devices()
Debug
Known issues
breakingPython 3.8 support was removed in `mypy-boto3-builder` version 8.12.0, which generates these type stubs. Consequently, `mypy-boto3-devicefarm` versions 1.42.x and newer require Python 3.9 or higher.fixUpgrade your Python environment to 3.9 or later. If unable to upgrade Python, use an older `mypy-boto3-devicefarm` version that supported Python 3.8 (e.g., < 1.42.0).
affects: mypy-boto3-devicefarm >= 1.42.0
breakingTypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. TypeDefs for packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes are moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). Code relying on older, explicit TypeDef names may break.fixUpdate your code to use the new TypeDef naming conventions. Refer to the `mypy-boto3-builder` documentation or regenerate stubs locally to find the correct names.
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-devicefarm versions generated by it)
gotcha`mypy-boto3-devicefarm` provides only type annotations for static analysis; it does not include the `boto3` runtime itself. For your code to run, `boto3` must be installed separately.fixEnsure `boto3` is installed alongside `mypy-boto3-devicefarm` (e.g., `pip install boto3 mypy-boto3-devicefarm`).
affects: All versions
gotchaFor optimal type checking and IDE experience, the version of `mypy-boto3-devicefarm` should ideally align with your installed `boto3` version. Mismatched versions can lead to incorrect or incomplete type hints.fixInstall `mypy-boto3-devicefarm` with a version that matches your `boto3` installation (e.g., `pip install boto3==1.x.y mypy-boto3-devicefarm==1.x.y`).
affects: All versions
gotchaWhile many IDEs and type checkers can infer types, explicitly annotating `boto3.client` and `boto3.session.client` calls with the `DeviceFarmClient` type (e.g., `client: DeviceFarmClient = session.client('devicefarm')`) is recommended for the most robust type checking and best autocompletion, especially in environments like VSCode.fixAdd explicit type annotations for boto3 client creations, as shown in the quickstart example.
affects: All versions
Upgrade
Version history
1.43.78latest on PyPI · released Aug 21, 2026
Audit
Dependencies
boto3requiredRuntime dependency for type checking. `mypy-boto3-devicefarm` provides type stubs for `boto3`'s DeviceFarm service. Although not a direct Python dependency, `boto3` must be installed to use these type stubs effectively.
pythonrequiredRequires Python 3.9 or higher. Support for Python 3.8 was removed in `mypy-boto3-builder` 8.12.0, which generates these type stubs.