{"id":3037,"library":"mypy-boto3-budgets","title":"mypy-boto3-budgets Type Stubs","description":"Type annotations for `boto3` AWS Budgets service, generated by `mypy-boto3-builder`. It provides type checking support for `boto3` clients, paginators, literals, and type definitions, compatible with various IDEs and type checkers like `mypy` and `pyright`. The library's version directly corresponds to the `boto3` version it types.","status":"active","version":"1.42.33","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","budgets"],"install":[{"cmd":"pip install boto3 mypy-boto3-budgets mypy","lang":"bash","label":"Install with boto3 and Mypy"}],"dependencies":[{"reason":"Provides the core AWS SDK functionality that these stubs type-hint.","package":"boto3","optional":false},{"reason":"The primary static type checker for which these stubs are designed.","package":"mypy","optional":false}],"imports":[{"note":"This is the primary way to get the type-hinted client for the Budgets service.","symbol":"BudgetsClient","correct":"from mypy_boto3_budgets import BudgetsClient"},{"note":"Literal types for service names are useful for precise type checking of client creation.","symbol":"BudgetsServiceName","correct":"from mypy_boto3_budgets.literals import BudgetsServiceName"},{"note":"Type definitions for service response objects and request parameters.","symbol":"BudgetTypeDef","correct":"from mypy_boto3_budgets.type_defs import BudgetTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_budgets import BudgetsClient\n    from mypy_boto3_budgets.type_defs import DescribeBudgetsOutputTypeDef\n\n# Initialize a boto3 session and client\nsession = boto3.session.Session()\nclient: BudgetsClient = session.client(\"budgets\")\n\n# Example usage with type-hinted client\ntry:\n    response: DescribeBudgetsOutputTypeDef = client.describe_budgets(AccountId=\"123456789012\")\n    print(\"Budgets found:\")\n    for budget in response.get('Budgets', []):\n        print(f\"  - {budget.get('BudgetName')}: {budget.get('BudgetType')}\")\nexcept client.exceptions.NotFoundException:\n    print(\"No budgets found for account.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to import and use the `BudgetsClient` type annotation with a `boto3` client. It shows how to correctly type-hint a client and then use it with a common operation like `describe_budgets`, benefiting from autocompletion and static type checking. Replace '123456789012' with a valid AWS account ID or use `os.environ.get` for programmatic access."},"warnings":[{"fix":"Upgrade Python to 3.9 or higher.","message":"Starting with mypy-boto3-builder version 8.12.0 (which generates mypy-boto3-budgets), support for Python 3.8 has been removed across all generated packages. Ensure your Python environment is 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Review and update explicit `TypeDef` imports and usage to reflect the new naming conventions.","message":"mypy-boto3-builder version 8.9.0 introduced breaking changes to generated TypeDef naming conventions. Packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes are moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This may affect explicit `TypeDef` imports.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"This package provides only type annotations. You must still install the actual `boto3` library for your code to run. `mypy-boto3-budgets` provides no runtime functionality on its own.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update `mypy` to the latest version: `pip install --upgrade mypy`.","message":"mypy-boto3-builder migrated to PEP 561 compliant packages with release 8.12.0. While this improves standard compatibility, ensure your `mypy` version is up-to-date to correctly discover and use these stub packages.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Consider `boto3-stubs-lite`, or configure PyCharm to use `mypy` or `pyright` for type checking, disabling its built-in type checker.","message":"PyCharm users might experience slow performance with Literal overloads in these stubs (due to PyCharm issue PY-40997). It is recommended to use `boto3-stubs-lite` (if available for the service), or disable PyCharm's type checker and rely on external tools like `mypy` or `pyright`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}