{"id":3339,"library":"mypy-boto3-bcm-pricing-calculator","title":"Type annotations for boto3 BillingandCostManagementPricingCalculator","description":"Provides type annotations for the `boto3` AWS Billing and Cost Management Pricing Calculator service. It enhances static type checking for `boto3` clients, resources, and their methods, offering improved autocomplete and error detection in IDEs and with tools like `mypy` and `pyright`. This package is part of the `mypy-boto3-builder` ecosystem, which typically releases updates in sync with `boto3` versions.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","billing","cost-management"],"install":[{"cmd":"pip install mypy-boto3-bcm-pricing-calculator boto3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK functions being type-hinted.","package":"boto3","optional":false}],"imports":[{"note":"Import directly from the service-specific `mypy-boto3` package, not a generic `boto3_stubs` path.","wrong":"from boto3_stubs.bcm_pricing_calculator.client import BillingandCostManagementPricingCalculatorClient","symbol":"BillingandCostManagementPricingCalculatorClient","correct":"from mypy_boto3_bcm_pricing_calculator.client import BillingandCostManagementPricingCalculatorClient"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_bcm_pricing_calculator.client import BillingandCostManagementPricingCalculatorClient\nfrom typing import TYPE_CHECKING, cast\nimport os\n\n# Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)\n# For a runnable example, ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION are set.\n# Or configure a mock client for testing without actual AWS calls.\n\nif TYPE_CHECKING:\n    client: BillingandCostManagementPricingCalculatorClient = boto3.client(\"bcm-pricing-calculator\")\nelse:\n    client = boto3.client(\"bcm-pricing-calculator\")\n\ntry:\n    # Example: Create a new bill scenario\n    # The Billing and Cost Management Pricing Calculator API is complex and often requires specific parameters.\n    # This is a minimal example; adjust parameters as per your actual use case.\n    scenario_name = f\"MyTypeHintedScenario-{os.urandom(4).hex()}\"\n    response = client.create_bill_scenario(\n        Name=scenario_name,\n        GroupSharingPreference='OPEN'\n    )\n    print(f\"Successfully created bill scenario: {response['name']} (ID: {response['id']})\")\n\n    # Example of retrieving scenarios (if any exist)\n    list_response = client.list_bill_scenarios()\n    print(\"\\nExisting Bill Scenarios:\")\n    for scenario in list_response.get('BillScenarios', []):\n        print(f\"  - {scenario['name']} (ID: {scenario['id']})\")\n\n    # For cleanup, you might delete the created scenario:\n    # client.delete_bill_scenario(Id=response['id'])\n    # print(f\"Deleted scenario {response['id']}\")\n\nexcept client.exceptions.AccessDeniedException:\n    print(\"Access Denied. Ensure your AWS credentials have permissions for bcm-pricing-calculator service.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `bcm-pricing-calculator` client with `boto3` and leverage the provided type hints. It includes an example of creating a bill scenario and listing existing ones. Ensure your AWS credentials are configured for authentication."},"warnings":[{"fix":"Upgrade to Python 3.9+ or pin `mypy-boto3-builder<8.12.0` / `mypy-boto3-bcm-pricing-calculator<1.42.3`.","message":"Python 3.8 support was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must pin an older version of `mypy-boto3-builder` or `mypy-boto3-bcm-pricing-calculator` if direct installation of this specific stub package is done, or upgrade their Python version.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.3 (package)"},{"fix":"Ensure your type checker (e.g., `mypy`, `pyright`) and IDE are updated to recent versions that fully support PEP 561. Reinstalling packages might be necessary.","message":"The `mypy-boto3-builder` migrated to PEP 561 compliant packages in version 8.12.0. This might affect how some tools discover or interpret type stubs, especially in older or less compliant environments.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.3 (package)"},{"fix":"For PyCharm, consider `mypy-boto3-lite` variants or external type checkers like `mypy` or `pyright`.","message":"PyCharm users may experience slow performance or high CPU usage due to `Literal` overloads. It is recommended to use `types-boto3-lite` (if available for this service) or disable PyCharm's type checker and rely on `mypy`/`pyright` for checks.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always install `boto3` (e.g., `pip install boto3 mypy-boto3-bcm-pricing-calculator`).","message":"This library provides *only* type annotations. `boto3` itself is a separate runtime dependency and must be installed alongside `mypy-boto3-bcm-pricing-calculator` for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review your code for any explicit imports of `TypeDef` objects, as their names might have been shortened or refactored. Consult the specific service's `mypy-boto3` documentation for exact type names.","message":"Breaking changes were introduced in `mypy-boto3-builder` 8.9.0, specifically regarding `TypeDef` naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While this specific service might not be directly affected by these exact names, similar changes could impact other generated types.","severity":"breaking","affected_versions":">=8.9.0 (builder)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}