mypy-boto3-bcm-data-exports Type Annotations

1.42.77 · active · verified Sat Apr 11

mypy-boto3-bcm-data-exports provides a set of type annotations for the `boto3` AWS SDK, specifically for the Billing and Cost Management Data Exports (BCM Data Exports) service. These annotations enhance code completion, static analysis, and type checking for `boto3` users with tools like MyPy, VSCode, and PyCharm. The library is currently at version 1.42.77 and is released frequently, typically in sync with `boto3` and `botocore` updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a `bcm-data-exports` client using `boto3` and explicitly annotate it with the `BCMDataExportsClient` type from `mypy-boto3-bcm-data-exports` for enhanced type checking and IDE support. It includes a basic example of calling `list_exports`.

import boto3
from mypy_boto3_bcm_data_exports.client import BCMDataExportsClient

def get_bcm_data_exports_client() -> BCMDataExportsClient:
    """Returns a type-hinted BCM Data Exports client."""
    client: BCMDataExportsClient = boto3.client(
        "bcm-data-exports",
        region_name="us-east-1",
        aws_access_key_id="{}".format(os.environ.get('AWS_ACCESS_KEY_ID', '')),
        aws_secret_access_key="{}".format(os.environ.get('AWS_SECRET_ACCESS_KEY', '')),
    )
    return client

# Example usage:
if __name__ == "__main__":
    import os
    client = get_bcm_data_exports_client()
    # You can now use 'client' with full type hints and autocomplete
    # For example, to list exports:
    try:
        response = client.list_exports()
        print("Successfully listed BCM Data Exports:")
        for export in response.get('Exports', []):
            print(f"  - {export.get('ExportArn')}")
    except Exception as e:
        print(f"Error listing exports: {e}")

view raw JSON →