{"id":3138,"library":"mypy-boto3-savingsplans","title":"mypy-boto3-savingsplans: Type Annotations for AWS Boto3 SavingsPlans","description":"mypy-boto3-savingsplans provides drop-in type annotations for the `boto3` AWS SDK's SavingsPlans service. It enhances static type checking and IDE auto-completion for `boto3.client('savingsplans')` calls. This package, currently at version `1.42.62`, is generated by `mypy-boto3-builder` and its releases are typically synchronized with `boto3` versions and `mypy-boto3-builder` updates.","status":"active","version":"1.42.62","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-hints","mypy","stubs","savingsplans"],"install":[{"cmd":"pip install boto3 mypy mypy-boto3-savingsplans","lang":"bash","label":"Install specific service stubs"},{"cmd":"pip install boto3 mypy 'boto3-stubs[savingsplans]'","lang":"bash","label":"Install via boto3-stubs umbrella package"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality.","package":"boto3"},{"reason":"Static type checker to leverage the annotations.","package":"mypy"},{"reason":"Required for certain type features on older Python versions, though usually installed transitively.","package":"typing-extensions","optional":true}],"imports":[{"note":"Type stubs are provided by `mypy-boto3-savingsplans`, not directly from `boto3` or its `client` module.","wrong":"from boto3.client import SavingsPlansClient","symbol":"SavingsPlansClient","correct":"from mypy_boto3_savingsplans.client import SavingsPlansClient"}],"quickstart":{"code":"import boto3\nfrom boto3.session import Session\nfrom mypy_boto3_savingsplans.client import SavingsPlansClient\nfrom typing import TYPE_CHECKING\n\n# Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)\n# For example, using environment variables for demonstration:\n# import os\n# os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY')\n# os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_SECRET_KEY')\n# os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1')\n\n# Recommended: Explicitly type the client for full IDE support and static analysis\nif TYPE_CHECKING:\n    client: SavingsPlansClient = Session().client('savingsplans')\nelse:\n    client = Session().client('savingsplans')\n\n# Example usage with type-checked methods\ntry:\n    response = client.describe_savings_plans(maxResults=10)\n    print(\"Successfully described Savings Plans:\")\n    for sp in response.get('savingsPlans', []):\n        print(f\"  - {sp.get('savingsPlanArn')}\")\nexcept client.exceptions.ClientError as e:\n    print(f\"Error describing Savings Plans: {e}\")\n","lang":"python","description":"This example demonstrates how to explicitly type a `boto3` SavingsPlans client using `mypy-boto3-savingsplans` for improved static analysis and IDE auto-completion. It then calls a sample API method."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. The `mypy-boto3-savingsplans` package itself requires `Python >=3.9`.","message":"Support for Python 3.8 was removed starting with `mypy-boto3-builder` version 8.12.0. Ensure your project uses Python 3.9 or higher for compatibility.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (affects all generated stubs)"},{"fix":"For most modern `mypy` and IDE setups, stubs should be automatically discovered. Ensure `mypy` is configured to find installed packages (`--no-site-packages` should NOT be used). In some cases, installing the umbrella `boto3-stubs` package might be preferred (`pip install 'boto3-stubs[savingsplans]'`).","message":"All `mypy-boto3` packages, including `mypy-boto3-savingsplans`, migrated to PEP 561 compatible packages with `mypy-boto3-builder` 8.12.0. This changes how type checkers discover stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (affects all generated stubs)"},{"fix":"Instead of `client = boto3.client('savingsplans')`, use `from mypy_boto3_savingsplans.client import SavingsPlansClient; client: SavingsPlansClient = boto3.client('savingsplans')`.","message":"For optimal IDE auto-completion and static type checking, explicitly type your `boto3` client instance using the imported `SavingsPlansClient` type, especially when using `boto3.session.Session().client(...)`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review your code for direct references to `TypeDef` names and adjust them according to the new naming conventions if they clash with changes. Consult the changelog for specific service updates.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` 8.9.0. This could affect code that directly references generated `TypedDict` names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (affects all generated stubs)"},{"fix":"Both methods provide the same type-checking benefits. `boto3-stubs` with extras is often simpler for multiple services, while individual packages can be lighter for single-service projects. Avoid installing both for the same service to prevent conflicts.","message":"The `mypy-boto3` ecosystem offers individual service packages (e.g., `mypy-boto3-savingsplans`) and an umbrella `boto3-stubs` package with extras (e.g., `boto3-stubs[savingsplans]`). Choose the installation method that best suits your project's dependency management.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update `mypy` to its latest version to maintain compatibility with new Python features and `typeshed` updates. Check `mypy`'s release notes for its current Python support matrix.","message":"Mypy itself has evolving Python version support. While `mypy-boto3-savingsplans` requires Python 3.9+, ensure your `mypy` version is compatible with your target Python runtime.","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"}