{"id":3157,"library":"mypy-boto3-tnb","title":"mypy-boto3-tnb","description":"mypy-boto3-tnb provides type annotations for the `boto3` TelcoNetworkBuilder (TNB) service. It is part of the `mypy-boto3` ecosystem, generated by `mypy-boto3-builder`, offering enhanced type checking and IDE auto-completion for `boto3` clients and related objects. The `mypy-boto3` project maintains a frequent release cadence, typically releasing updates monthly or bi-monthly to keep pace with `boto3` and `botocore` changes.","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-hints","telconetworkbuilder","tnb","stub"],"install":[{"cmd":"pip install mypy-boto3-tnb boto3","lang":"bash","label":"Install with boto3 runtime"}],"dependencies":[{"reason":"Runtime library for AWS SDK in Python; `mypy-boto3-tnb` provides type stubs for this library, not the implementation itself.","package":"boto3","optional":false}],"imports":[{"note":"Imports the typed client for the TelcoNetworkBuilder service.","symbol":"TelcoNetworkBuilderClient","correct":"from mypy_boto3_tnb.client import TelcoNetworkBuilderClient"},{"note":"Imports a sample TypeDef for input parameters, common for explicit type hinting of request/response objects. Specific TypeDef names should be looked up in the library's documentation or IDE autocomplete.","symbol":"CreateSolFunctionPackageInputRequestTypeDef","correct":"from mypy_boto3_tnb.type_defs import CreateSolFunctionPackageInputRequestTypeDef"},{"note":"The primary client class is named `TelcoNetworkBuilderClient` or `TNBClient` depending on context and specific generated version, not `TnbClient`. Always refer to documentation or IDE for exact generated name.","wrong":"from mypy_boto3_tnb.client import TnbClient","symbol":"TnbClient","correct":"from mypy_boto3_tnb import TNBClient"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_tnb.client import TelcoNetworkBuilderClient\nfrom mypy_boto3_tnb.type_defs import CreateSolFunctionPackageOutputTypeDef\n\ndef create_tnb_function_package(package_name: str) -> CreateSolFunctionPackageOutputTypeDef:\n    # mypy-boto3-tnb provides type hints, boto3 is the runtime\n    client: TelcoNetworkBuilderClient = boto3.client(\"tnb\")\n\n    # Example API call with type hinting for input and output\n    response: CreateSolFunctionPackageOutputTypeDef = client.create_sol_function_package(\n        tags={\n            \"Name\": package_name\n        }\n    )\n    print(f\"Successfully created SOL Function Package: {response.get('id')}\")\n    return response\n\nif __name__ == \"__main__\":\n    # This code is for demonstration and requires AWS credentials configured\n    # It will attempt to create a resource, which may incur costs.\n    # Replace 'my-test-package' with a unique name.\n    try:\n        package_output = create_tnb_function_package(\"my-test-package\")\n        # Additional operations with package_output can be typed here\n    except Exception as e:\n        print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-tnb` to add type hints for the TelcoNetworkBuilder service client. It shows the explicit import of the typed client and a `TypeDef` for return values, enhancing code completion and type checking for `boto3` operations. Remember to have AWS credentials configured for the `boto3.client` call to succeed."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support was removed with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9 or newer to use newly generated stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and subsequently generated `mypy-boto3-*` packages)"},{"fix":"Update your type checker (e.g., `pip install --upgrade mypy pyright`). Review your type checker configuration if issues persist.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages with `mypy-boto3-builder` 8.12.0. While this generally improves type checker compatibility, ensure your type checker (e.g., MyPy, Pyright) is up-to-date to properly discover the new package structure.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (and subsequently generated `mypy-boto3-*` packages)"},{"fix":"Update your `TypeDef` import paths and names in your code to match the new conventions. Use IDE autocomplete or generated documentation to find the correct names.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) or had postfixes moved, which can break explicit `TypeDef` imports.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (and subsequently generated `mypy-boto3-*` packages)"},{"fix":"Ensure `boto3` is installed alongside `mypy-boto3-tnb` in your project environment.","message":"This library provides *only* type annotations. You must still install the `boto3` runtime library (e.g., `pip install boto3`) for your code to function at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type annotations to your `boto3.client()` and `boto3.resource()` calls, e.g., `client: TelcoNetworkBuilderClient = boto3.client(\"tnb\")`.","message":"For optimal type checking, especially with standalone stub packages like `mypy-boto3-tnb`, it is recommended to explicitly annotate `boto3.client()` and `boto3.resource()` calls with the imported client types. While some IDEs might infer types, explicit annotations ensure consistent and reliable type checking across tools.","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"}