mypy-boto3-finspace-data Type Annotations

1.42.3 · active · verified Sat Apr 11

This package provides type annotations for the `boto3` FinSpaceData service, generated with `mypy-boto3-builder`. It ensures type checking for your AWS FinSpaceData client code. The current version is 1.42.3, and releases are frequent, typically in sync with new `boto3` and `botocore` versions, or when new AWS service features are released.

Warnings

Install

Imports

Quickstart

This example demonstrates how to initialize a `boto3` client with type hints from `mypy-boto3-finspace-data` and make a sample API call. The `TYPE_CHECKING` block ensures these imports are only used by type checkers, not at runtime.

from typing import TYPE_CHECKING
import boto3

if TYPE_CHECKING:
    from mypy_boto3_finspace_data.client import FinSpaceDataClient
    from mypy_boto3_finspace_data.type_defs import ListChangesetsResponseTypeDef

try:
    # Initialize the boto3 client for FinSpaceData
    client: FinSpaceDataClient = boto3.client('finspace-data')

    # Example API call: ListChangesets
    # Note: Replace 'your-dataset-id' with an actual FinSpaceData dataset ID
    # or use a placeholder for type checking demonstration.
    dataset_id = 'your-dataset-id' # os.environ.get('FINSPACE_DATA_DATASET_ID', 'placeholder')

    if dataset_id == 'your-dataset-id':
        print("Please provide a valid FinSpaceData dataset ID for a successful API call.")
        # For demonstration, we'll simulate a response structure for type checking.
        response: ListChangesetsResponseTypeDef = {
            'changesets': [],
            'nextToken': 'string',
            'ResponseMetadata': {
                'RequestId': 'string',
                'HTTPStatusCode': 200,
                'HTTPHeaders': {},
                'RetryAttempts': 0
            }
        }
    else:
        response = client.list_changesets(datasetId=dataset_id)
        print(f"Successfully listed changesets for dataset '{dataset_id}'.")
        print(f"First changeset ID: {response['changesets'][0]['changesetId'] if response['changesets'] else 'N/A'}")

    # Type check the response structure
    _ = response['changesets']
    _ = response['ResponseMetadata']

except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →