mypy-boto3-taxsettings: Type Annotations for AWS TaxSettings

1.42.3 · active · verified Sat Apr 11

mypy-boto3-taxsettings provides comprehensive type annotations for the AWS boto3 TaxSettings service, enabling robust static type checking with tools like MyPy, PyRight, VSCode, and PyCharm. It is currently at version 1.42.3, generated by `mypy-boto3-builder` 8.12.0, and is actively maintained with frequent updates that typically follow boto3 releases.

Warnings

Install

Imports

Quickstart

Demonstrates how to use type hints for the TaxSettingsClient. The `if TYPE_CHECKING:` block ensures that type imports are only active during type checking, avoiding runtime import issues and improving performance. An explicit type annotation is used for the client and return type for clarity.

from typing import TYPE_CHECKING
import boto3

if TYPE_CHECKING:
    from mypy_boto3_taxsettings.client import TaxSettingsClient
    from mypy_boto3_taxsettings.type_defs import GetTaxRegistrationOutputTypeDef


def get_tax_registration_details(region: str) -> 'GetTaxRegistrationOutputTypeDef':
    client: TaxSettingsClient = boto3.client("taxsettings", region_name=region)
    response = client.get_tax_registration()
    print(response)
    return response

if __name__ == "__main__":
    # Replace 'us-east-1' with your desired AWS region
    # ensure your AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY env vars or ~/.aws/credentials)
    try:
        tax_details = get_tax_registration_details("us-east-1")
        print(f"Successfully retrieved tax registration details: {tax_details}")
    except Exception as e:
        print(f"Error retrieving tax registration details: {e}")

view raw JSON →