{"id":3623,"library":"mypy-boto3-managedblockchain","title":"Type Annotations for boto3 ManagedBlockchain","description":"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.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-stubs","managedblockchain","type-checking"],"install":[{"cmd":"pip install boto3 mypy-boto3-managedblockchain","lang":"bash","label":"Install with boto3 runtime"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python (Boto3).","package":"boto3"},{"reason":"Required to perform static type checking using these stubs.","package":"mypy","optional":true}],"imports":[{"note":"The `ManagedBlockchainClient` type is provided by the stub package for explicit type hinting, not directly from `boto3.client`.","wrong":"from boto3.client import ManagedBlockchainClient","symbol":"ManagedBlockchainClient","correct":"from mypy_boto3_managedblockchain.client import ManagedBlockchainClient"},{"note":"The primary way to use these stubs is by type-hinting the client returned by `boto3.client('service_name')`.","symbol":"list_networks","correct":"client: ManagedBlockchainClient = boto3.client(\"managedblockchain\"); client.list_networks()"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_managedblockchain.client import ManagedBlockchainClient\nfrom mypy_boto3_managedblockchain.type_defs import ListNetworksOutputTypeDef\n\n# Ensure you have AWS credentials configured, e.g., via environment variables or ~/.aws/credentials\n# This example does not perform actual network requests, but uses type hints.\n\ndef get_managedblockchain_networks() -> ListNetworksOutputTypeDef:\n    # Type hint the boto3 client with the stub-provided client type\n    client: ManagedBlockchainClient = boto3.client(\"managedblockchain\")\n\n    # Use a common ManagedBlockchain operation\n    response = client.list_networks(MaxResults=10)\n\n    print(f\"Found {len(response['Networks'])} ManagedBlockchain networks.\")\n    return response\n\nif __name__ == \"__main__\":\n    # Example usage (this will require actual AWS credentials if uncommented and run)\n    # get_managedblockchain_networks()\n    # You can run `mypy your_script.py` to check types\n    pass # No runtime execution for quickstart to avoid credential requirement","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 support was removed from version 8.12.0 onwards. All `mypy-boto3` packages now require Python 3.9 or higher.","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Update your code to use the new, shorter TypedDict names where applicable. Consult the `mypy-boto3` documentation or regenerate your code if you are using custom builder scripts.","message":"TypeDef naming conventions changed in version 8.9.0, often resulting in shorter names for method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). Custom type hints or direct usage of generated TypeDefs might break.","severity":"breaking","affected_versions":">=8.9.0"},{"fix":"Always include `boto3` in your project's dependencies: `pip install boto3 mypy-boto3-managedblockchain`.","message":"The `mypy-boto3-managedblockchain` package provides only type stubs. You must also install `boto3` (the actual AWS SDK runtime) for your application to function correctly at runtime.","severity":"gotcha","affected_versions":"all"},{"fix":"Always refer to the official boto3 documentation for the latest service client names. If a service name changes, update your `boto3.client()` calls and corresponding `mypy-boto3` stub package installation.","message":"Service names for `boto3.client()` calls can change over time (e.g., `sms-voice` became `pinpoint-sms-voice`). While `managedblockchain` is stable, be aware of this for other services, as `mypy-boto3` tracks these upstream changes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}