Type Annotations for boto3 ManagedBlockchain

1.42.3 · active · verified Sat Apr 11

mypy-boto3-managedblockchain provides type annotations for the boto3 ManagedBlockchain service, enabling static type checking with tools like MyPy. It is currently at version 1.42.3 and is part of the `mypy-boto3` ecosystem, which releases frequently, often daily, to keep up with `boto3` and `botocore` updates and new AWS service features.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-managedblockchain` to add type hints to your `boto3` client calls. It shows how to import the specific client type and use it with `boto3.client()`, enabling static type checking for service-specific methods and response structures. Run `mypy your_script.py` to verify types.

import boto3
from mypy_boto3_managedblockchain.client import ManagedBlockchainClient
from mypy_boto3_managedblockchain.type_defs import ListNetworksOutputTypeDef

# Ensure you have AWS credentials configured, e.g., via environment variables or ~/.aws/credentials
# This example does not perform actual network requests, but uses type hints.

def get_managedblockchain_networks() -> ListNetworksOutputTypeDef:
    # Type hint the boto3 client with the stub-provided client type
    client: ManagedBlockchainClient = boto3.client("managedblockchain")

    # Use a common ManagedBlockchain operation
    response = client.list_networks(MaxResults=10)

    print(f"Found {len(response['Networks'])} ManagedBlockchain networks.")
    return response

if __name__ == "__main__":
    # Example usage (this will require actual AWS credentials if uncommented and run)
    # get_managedblockchain_networks()
    # You can run `mypy your_script.py` to check types
    pass # No runtime execution for quickstart to avoid credential requirement

view raw JSON →