{"id":3649,"library":"mypy-boto3-networkmonitor","title":"Type Annotations for boto3 CloudWatch Network Monitor","description":"mypy-boto3-networkmonitor provides comprehensive type annotations for the `boto3` CloudWatch Network Monitor service (version 1.42.3). Generated by `mypy-boto3-builder` 8.12.0, it enhances developer experience by enabling static type checking with tools like mypy and pyright, and improving code completion in IDEs like VSCode and PyCharm. This library helps to proactively identify and fix potential type-related bugs in `boto3` code at development time.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-hints","mypy","cloudwatch","networkmonitor","static-analysis","typing"],"install":[{"cmd":"pip install mypy-boto3-networkmonitor","lang":"bash","label":"Install standalone package"},{"cmd":"pip install 'boto3-stubs[networkmonitor]'","lang":"bash","label":"Install as part of boto3-stubs"}],"dependencies":[{"reason":"This package provides type annotations for the `boto3` library; `boto3` itself is a mandatory runtime dependency.","package":"boto3","optional":false},{"reason":"Required for static type checking to utilize the provided type annotations.","package":"mypy","optional":true}],"imports":[{"note":"Client for the CloudWatch Network Monitor service.","symbol":"NetworkMonitorClient","correct":"from mypy_boto3_networkmonitor.client import NetworkMonitorClient"},{"note":"Type annotations for Paginators, e.g., for listing monitors.","symbol":"Paginator","correct":"from mypy_boto3_networkmonitor.paginator import ListMonitorsPaginator"},{"note":"Provides type-checked string literals for service-specific values.","symbol":"Literal","correct":"from mypy_boto3_networkmonitor.literals import MonitorStateTypeDef"},{"note":"Provides type definitions for API request and response structures (TypedDicts).","symbol":"TypeDef","correct":"from mypy_boto3_networkmonitor.type_defs import MonitorSummaryTypeDef"}],"quickstart":{"code":"import os\nimport boto3\nfrom boto3.session import Session\nfrom mypy_boto3_networkmonitor.client import NetworkMonitorClient\n\ndef get_network_monitor_client() -> NetworkMonitorClient:\n    # Assuming AWS credentials are set via environment variables or AWS CLI config\n    session = Session(region_name=os.environ.get('AWS_DEFAULT_REGION', 'us-east-1'))\n    client: NetworkMonitorClient = session.client(\"networkmonitor\")\n    return client\n\nclient = get_network_monitor_client()\nresponse = client.list_monitors()\nprint(response.get('Monitors'))","lang":"python","description":"This example demonstrates how to obtain a type-annotated `NetworkMonitorClient` from a `boto3` session and use it to call an API method. Type annotations ensure that `client` methods and their arguments are correctly validated by a static type checker."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. If you must use Python 3.8, you will need to pin `mypy-boto3-networkmonitor` to an older compatible version (e.g., <1.42.3) and `mypy-boto3-builder` to <8.12.0.","message":"As of `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-networkmonitor 1.42.3`), Python 3.8 support has been officially removed for all generated packages.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, mypy-boto3-networkmonitor >= 1.42.3"},{"fix":"Update your code to use the shorter, revised TypeDef names. Refer to the specific service documentation or generated stub files for the correct names if encountering type errors.","message":"Type definition (TypeDef) naming conventions changed in `mypy-boto3-builder` 8.9.0. This could affect code that explicitly imports or refers to TypeDefs by their full, verbose names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0, mypy-boto3-networkmonitor >= 1.35.0 (approximate)"},{"fix":"For the latest and most comprehensive type annotations, prefer installing `boto3-stubs` with specific service extras (e.g., `boto3-stubs[networkmonitor]`) or the standalone `mypy-boto3-networkmonitor` package directly.","message":"The legacy `mypy-boto3` package was separated from the main `boto3-stubs` product in `mypy-boto3-builder` 8.9.0. Users upgrading from older `mypy-boto3` installations might find that new services or updates are not available via the old package.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"It is recommended to use `boto3-stubs-lite` (e.g., `pip install 'boto3-stubs-lite[networkmonitor]'`) as a more RAM-friendly alternative, though it requires more explicit type annotations. Alternatively, consider disabling PyCharm's built-in type checker and relying solely on an external checker like `mypy` or `pyright`.","message":"PyCharm users might experience slow performance or high CPU usage due to how PyCharm handles `Literal` overloads in `mypy-boto3` generated stubs (PyCharm issue PY-40997).","severity":"gotcha","affected_versions":"All versions of mypy-boto3-*, specific to PyCharm users."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}