{"id":3680,"library":"mypy-boto3-rbin","title":"mypy-boto3-rbin: Type Annotations for AWS Recycle Bin","description":"mypy-boto3-rbin provides static type annotations for the AWS boto3 Recycle Bin (rbin) service, generated by `mypy-boto3-builder`. It enhances development with `boto3` by offering type hints for clients, waiters, paginators, and service-specific TypeDefs. The library is actively maintained and frequently updated to synchronize with new `boto3` releases and AWS service changes, currently at version 1.42.3, reflecting the latest `mypy-boto3-builder` updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","types","type-annotations","rbin","recycle-bin"],"install":[{"cmd":"pip install mypy-boto3-rbin","lang":"bash","label":"Install library"},{"cmd":"pip install boto3 mypy-boto3-rbin","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Runtime dependency for which these are type stubs. Required for actual AWS API calls.","package":"boto3","optional":false}],"imports":[{"symbol":"RecycleBinClient","correct":"from mypy_boto3_rbin.client import RecycleBinClient"},{"note":"TypeDefs usually end with `TypeDef` to distinguish them from runtime classes or methods.","wrong":"from mypy_boto3_rbin.type_defs import ListRulesResponse","symbol":"ListRulesResponseTypeDef","correct":"from mypy_boto3_rbin.type_defs import ListRulesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_rbin.client import RecycleBinClient\nfrom typing import TYPE_CHECKING\n\n# It's recommended to use TYPE_CHECKING guard for type stubs\nif TYPE_CHECKING:\n    # mypy will use RecycleBinClient for type checking here\n    rbin_client: RecycleBinClient = boto3.client(\"rbin\")\nelse:\n    # At runtime, it's just a regular boto3 client\n    rbin_client = boto3.client(\"rbin\")\n\n# Example: List all recovery rules\ntry:\n    print(\"Listing RBin recovery rules...\")\n    response = rbin_client.list_rules()\n    rules = response.get(\"Rules\", [])\n    print(f\"Found {len(rules)} recovery rules.\")\n    for rule in rules:\n        print(f\"  - Rule ID: {rule['Id']}, ARN: {rule['RuleArn']}\")\nexcept Exception as e:\n    print(f\"Error listing RBin rules: {e}\")","lang":"python","description":"Demonstrates how to import and use the `RecycleBinClient` type annotation with `boto3.client()`, including a `TYPE_CHECKING` guard for best practice."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 is no longer supported for any `mypy-boto3` packages since `mypy-boto3-builder` 8.12.0. Projects using these stubs must upgrade their Python environment to 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-rbin 1.42.3 and later"},{"fix":"Ensure both `boto3` and `mypy-boto3-rbin` are installed: `pip install boto3 mypy-boto3-rbin`.","message":"`mypy-boto3-rbin` provides only type stubs; you must install `boto3` separately for runtime functionality. These packages are not replacements for the actual AWS SDK.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `import mypy_boto3_rbin` or specific submodules like `from mypy_boto3_rbin.client import RecycleBinClient`.","message":"The installed package name uses hyphens (`mypy-boto3-rbin`), but the Python import path uses underscores (`mypy_boto3_rbin`). Attempting to import `mypy-boto3-rbin` directly will result in an `ImportError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review and update `TypeDef` import paths and names in your codebase according to the new conventions.","message":"TypeDef naming conventions changed significantly in `mypy-boto3-builder` 8.9.0. TypeDefs for packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Conflicting `Extra` postfixes moved to the end. This may require updating existing type annotations in your codebase.","severity":"breaking","affected_versions":"mypy-boto3-rbin versions generated by builder 8.9.0 and later (e.g., 1.42.3)"},{"fix":"Wrap client type hints in `if TYPE_CHECKING:` blocks, as shown in the quickstart example.","message":"When using type annotations with `boto3.client()`, it's recommended to use a `typing.TYPE_CHECKING` block. This prevents runtime dependency on the stub packages and avoids potential issues in environments where type checking is not performed.","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"}