Install & Compatibility
Where this runs
tested against v1.43.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DirectoryServiceDataClient
✓ from mypy_boto3_ds_data import DirectoryServiceDataClient
✗ from mypy_boto3_ds_data import DirectoryServiceDataClient
This quickstart demonstrates how to initialize a type-hinted `DirectoryServiceDataClient` and use it to call a service method like `list_tags_for_resource`. It shows importing the client type and a request `TypeDef` for enhanced type checking. Remember to replace placeholder `ResourceId` with a valid one in your AWS account for actual execution.
import boto3
from mypy_boto3_ds_data.client import DirectoryServiceDataClient
from mypy_boto3_ds_data.type_defs import ListTagsForResourceRequestRequestTypeDef
import os
def get_directory_service_data_client() -> DirectoryServiceDataClient:
"""Initializes and returns a type-hinted DirectoryServiceData client."""
# Actual credentials will come from environment variables or AWS config
# os.environ.get('AWS_ACCESS_KEY_ID', ''), etc.
return boto3.client("ds-data")
client: DirectoryServiceDataClient = get_directory_service_data_client()
# Example usage with type-checked parameters
# Replace 'd-xxxxxxxxxx' with an actual Directory ID in your AWS account
# or handle if the resource might not exist.
resource_id = os.environ.get('DS_DATA_RESOURCE_ID', 'd-xxxxxxxxxx') # Placeholder
try:
params: ListTagsForResourceRequestRequestTypeDef = {
"ResourceId": resource_id
}
response = client.list_tags_for_resource(**params)
print("Tags for resource:")
for tag in response.get('Tags', []):
print(f" {tag['Key']}: {tag['Value']}")
except client.exceptions.ResourceNotFoundException:
print(f"Resource ID '{resource_id}' not found. Please provide a valid Directory ID.")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingmypy-boto3-builder 8.12.0 removed support for Python 3.8. Projects relying on older Python versions for stubs will need to use an older builder version or upgrade Python.fixUpgrade your Python environment to 3.9 or higher. If unable to upgrade, pin `mypy-boto3-builder` to `<8.12.0` and regenerate stubs, or use an older `mypy-boto3-*` package version if available.
affects: >=8.12.0 (builder)
gotchaThis package (`mypy-boto3-ds-data`) provides only type stubs. You must install `boto3` separately to have the actual runtime functionality.fixEnsure `boto3` is installed in your project: `pip install boto3`.
affects: All
gotchaType stubs are generated for specific `boto3` versions. Using `mypy-boto3-ds-data` with a significantly mismatched `boto3` version can lead to incorrect or incomplete type checking, as API definitions may differ.fixKeep your `mypy-boto3-ds-data` package version in sync with your `boto3` version. The `mypy-boto3` project aims to release stubs aligned with `boto3` releases.
affects: All
gotchaWhen type-hinting a boto3 client or resource, the specific type definitions (e.g., `DirectoryServiceDataClient`) are imported from the `mypy_boto3_SERVICE_NAME` package, not directly from `boto3`.fixUse `from mypy_boto3_ds_data.client import DirectoryServiceDataClient` (or similar for other services/types) when type-hinting clients and service-specific types.
affects: All
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
No dependency data recorded yet.