{"id":3655,"library":"mypy-boto3-odb","title":"mypy-boto3-odb Type Stubs","description":"mypy-boto3-odb provides static type annotations for the boto3 Odb service client, enhancing development with type checking, auto-completion, and error detection in IDEs and with tools like Mypy. It is part of the 'mypy-boto3' ecosystem, automatically generated by `mypy-boto3-builder`, and is currently at version 1.42.80. The library receives frequent updates to align with upstream boto3 releases.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-stubs","boto3","aws","mypy","type-checking","sdk","odb"],"install":[{"cmd":"pip install mypy-boto3-odb","lang":"bash","label":"Standalone service stubs"},{"cmd":"pip install 'boto3-stubs[odb]'","lang":"bash","label":"As part of boto3-stubs meta-package (recommended)"}],"dependencies":[{"reason":"Provides the actual AWS SDK runtime functionality; these are only type stubs.","package":"boto3"},{"reason":"The primary static type checker designed to utilize these stubs.","package":"mypy","optional":true}],"imports":[{"note":"While 'boto3-stubs' is the umbrella package, service-specific client types are directly imported from 'mypy_boto3_<service_name>' for explicit type hints.","wrong":"from boto3_stubs.odb import OdbClient","symbol":"OdbClient","correct":"from mypy_boto3_odb import OdbClient"},{"note":"For precise type checking of Boto3 response structures, TypedDict definitions are imported from the service's `type_defs` submodule.","symbol":"GetProfileOutputTypeDef","correct":"from mypy_boto3_odb.type_defs import GetProfileOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_odb import OdbClient\n    from mypy_boto3_odb.type_defs import GetProfileOutputTypeDef\n\ndef get_odb_profile(profile_id: str) -> GetProfileOutputTypeDef:\n    # Initialize an Odb client with type hints\n    client: OdbClient = boto3.client(\"odb\")\n\n    # Example API call (replace with actual Odb service calls)\n    # The actual Odb service is not widely known; this is illustrative.\n    response: GetProfileOutputTypeDef = client.get_profile(ProfileId=profile_id)\n    print(f\"Retrieved Odb profile for {profile_id}: {response.get('Name')}\")\n    return response\n\n# Example usage (requires AWS credentials configured for boto3)\nif __name__ == \"__main__\":\n    # In a real scenario, profile_id would come from input or configuration\n    sample_profile_id = \"some-odb-profile-id\"\n    try:\n        # This call will fail at runtime if the 'odb' service or 'get_profile' API \n        # does not exist or if credentials are not configured correctly.\n        # The purpose here is to demonstrate type hinting at static analysis time.\n        # response_data = get_odb_profile(sample_profile_id)\n        print(\"Type hinting for OdbClient and response types demonstrated.\")\n        print(\"To run, ensure 'boto3' is installed and AWS credentials are configured.\")\n        print(\"Note: 'odb' is a less common AWS service; adjust API calls as needed.\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n","lang":"python","description":"This example demonstrates how to import and apply type hints for the `OdbClient` and its response types. It initializes a `boto3` client with the `OdbClient` type, allowing static analysis tools like Mypy and IDEs to provide auto-completion and type checking for Odb service calls. The `TYPE_CHECKING` block ensures that the `mypy_boto3_odb` import is only active during type checking, avoiding a runtime dependency on the stubs if desired. Replace `get_profile` with actual Odb service operations."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer. Ensure your project's `pyproject.toml` or `setup.cfg` correctly defines PEP 561 entry points if building custom stubs.","message":"The `mypy-boto3-builder` (which generates these stubs) migrated to PEP 561 compliant packages and removed support for Python 3.8.","severity":"breaking","affected_versions":"mypy-boto3-builder versions >= 8.12.0"},{"fix":"Update any custom `TypeDef` references in your codebase to reflect the new naming conventions provided by the stubs.","message":"TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end.","severity":"breaking","affected_versions":"mypy-boto3-builder versions >= 8.9.0"},{"fix":"Migrate any existing usage from the `sms-voice` service to `pinpoint-sms-voice` in your `boto3` calls and corresponding type stub imports.","message":"The `sms-voice` service is no longer supported and has been excluded from builds. Use `pinpoint-sms-voice` instead.","severity":"deprecated","affected_versions":"mypy-boto3-builder versions >= 8.11.0"},{"fix":"Ensure `pip install boto3` is executed in your project's environment alongside `mypy-boto3-odb`.","message":"These are type stubs only; the actual `boto3` library must be installed separately in your environment for runtime functionality.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type hints for the client object, e.g., `client: OdbClient = boto3.client(\"odb\")`.","message":"In some IDEs (e.g., VSCode without Pylance, or older PyCharm versions), explicit type annotations for `boto3.client()` or `boto3.resource()` calls might be required to enable full autocomplete and type checking.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `from typing import TYPE_CHECKING; if TYPE_CHECKING: from mypy_boto3_odb import OdbClient else: OdbClient = object` for conditional imports.","message":"For Pylint compatibility and to avoid a runtime dependency on stubs in production, it is recommended to wrap stub imports within `typing.TYPE_CHECKING` blocks.","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"}