Type annotations for aiobotocore DataExchange

3.4.0 · active · verified Mon Apr 13

This library provides high-quality type annotations for the `aiobotocore` DataExchange service, generated by `mypy-boto3-builder`. It enables static type checking for `aiobotocore` applications, enhancing code reliability and developer experience. The current version is 3.4.0, and it follows a rapid release cadence aligned with updates to `aiobotocore` and the `mypy-boto3-builder`.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize an `aiobotocore` DataExchange client and apply type hints from `types-aiobotocore-dataexchange` for static analysis. It then performs a simple API call to list data sets, showing how response types can also be hinted.

import asyncio
import aiobotocore.session
from types_aiobotocore_dataexchange.client import DataExchangeClient
from types_aiobotocore_dataexchange.type_defs import ListDataSetsResponseTypeDef

async def main():
    session = aiobotocore.session.get_session()
    # Using 'dataexchange' service name with type annotation
    async with session.create_client("dataexchange") as client:
        client: DataExchangeClient  # Type hint for mypy
        print(f"Client type: {type(client)}")

        # Example API call with type-hinted response
        try:
            response: ListDataSetsResponseTypeDef = await client.list_data_sets(
                MaxResults=1
            )
            print("Successfully listed DataExchange data sets.")
            if response.get("DataSets"):
                print("First Data Set ID:", response["DataSets"][0]["DataSetId"])
            else:
                print("No data sets found.")
        except Exception as e:
            print(f"Error listing data sets: {e}")

if __name__ == "__main__":
    asyncio.run(main())

view raw JSON →