mypy-boto3-rbin: Type Annotations for AWS Recycle Bin

1.42.3 · active · verified Sat Apr 11

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.

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use the `RecycleBinClient` type annotation with `boto3.client()`, including a `TYPE_CHECKING` guard for best practice.

import boto3
from mypy_boto3_rbin.client import RecycleBinClient
from typing import TYPE_CHECKING

# It's recommended to use TYPE_CHECKING guard for type stubs
if TYPE_CHECKING:
    # mypy will use RecycleBinClient for type checking here
    rbin_client: RecycleBinClient = boto3.client("rbin")
else:
    # At runtime, it's just a regular boto3 client
    rbin_client = boto3.client("rbin")

# Example: List all recovery rules
try:
    print("Listing RBin recovery rules...")
    response = rbin_client.list_rules()
    rules = response.get("Rules", [])
    print(f"Found {len(rules)} recovery rules.")
    for rule in rules:
        print(f"  - Rule ID: {rule['Id']}, ARN: {rule['RuleArn']}")
except Exception as e:
    print(f"Error listing RBin rules: {e}")

view raw JSON →