{"id":3559,"library":"mypy-boto3-bcm-dashboards","title":"mypy-boto3-bcm-dashboards Type Annotations","description":"This package provides type annotations (stubs) for the `boto3` AWS SDK, specifically for the 'BillingandCostManagementDashboards' service. It allows static type checkers like `mypy` to validate `boto3` client calls, improving code quality and catching potential errors early. The library is part of the `mypy-boto3-builder` project, which generates stubs for all `boto3` services and releases frequently, often in sync with `boto3` and builder updates. Current version is 1.42.87.","status":"active","version":"1.42.87","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","typescript","billing-cost-management-dashboards"],"install":[{"cmd":"pip install mypy-boto3-bcm-dashboards boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides runtime functionality for AWS SDK calls, which these stubs type-check.","package":"boto3"},{"reason":"The static type checker that utilizes these stubs for type validation.","package":"mypy","optional":true}],"imports":[{"note":"Client types are specifically located in the `.client` submodule.","wrong":"from mypy_boto3_bcm_dashboards import BillingandCostManagementDashboardsClient","symbol":"BillingandCostManagementDashboardsClient","correct":"from mypy_boto3_bcm_dashboards.client import BillingandCostManagementDashboardsClient"},{"note":"Directly annotating with `boto3.client` results in `Any` or incomplete type information. Always use the specific generated stub client type for full type safety.","wrong":"bcm_client: Client = boto3.client('billing-cost-management-dashboards')","symbol":"Client","correct":"from boto3.session import Session\nbcm_client: BillingandCostManagementDashboardsClient = Session().client('billing-cost-management-dashboards')"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_bcm_dashboards.client import BillingandCostManagementDashboardsClient\nfrom typing import List, Dict, Any\n\ndef get_dashboards(client: BillingandCostManagementDashboardsClient) -> List[Dict[str, Any]]:\n    try:\n        response = client.list_dashboards(\n            MaxResults=10\n        )\n        return response.get('Dashboards', [])\n    except client.exceptions.ResourceNotFoundException:\n        print(\"No dashboards found.\")\n        return []\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        return []\n\nif __name__ == '__main__':\n    # Example usage with boto3 client\n    bcm_client: BillingandCostManagementDashboardsClient = boto3.client('billing-cost-management-dashboards')\n    dashboards = get_dashboards(bcm_client)\n    print(f\"Found {len(dashboards)} dashboards.\")\n    # This code can now be type-checked by mypy for correct API usage\n","lang":"python","description":"Demonstrates how to initialize a `boto3` client and type-hint it with `mypy-boto3-bcm-dashboards` for static analysis. This allows `mypy` to verify the client's methods and parameters."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must upgrade to Python 3.9 or newer to continue receiving updates and fixes for `mypy-boto3` stubs.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"fix":"Ensure `pip` and `setuptools` are updated (`pip install --upgrade pip setuptools`). Check your `mypy` configuration if issues persist.","message":"The `mypy-boto3` builder migrated all packages to PEP 561 compliance in version 8.12.0. While this improves packaging and type checker compatibility, it might affect custom packaging setups or older environments. Ensure your `pip` and `setuptools` are up-to-date.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"fix":"Review and update explicit TypeDef references in your code to match the new, shorter names.","message":"In `mypy-boto3-builder` version 8.9.0, TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If your code explicitly references these types, you may need to update their names.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Use `import mypy_boto3_bcm_dashboards` (or submodules) in your Python code.","message":"The installed package name `mypy-boto3-bcm-dashboards` uses hyphens, but the Python import path uses underscores (`mypy_boto3_bcm_dashboards`). Always use underscores in your import statements.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}