{"id":3645,"library":"mypy-boto3-neptunedata","title":"mypy-boto3-neptunedata Type Annotations","description":"mypy-boto3-neptunedata provides type annotations for the `boto3` NeptuneData service, generated by `mypy-boto3-builder`. It enhances development with `boto3` by enabling static type checking for NeptuneData client methods and response/request structures. The current version is 1.42.78, with new releases frequently, often mirroring `boto3` and `botocore` updates.","status":"active","version":"1.42.78","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","neptunedata","mypy","type-hints","type-checking","stubs"],"install":[{"cmd":"pip install mypy-boto3-neptunedata","lang":"bash","label":"Install service stubs"},{"cmd":"pip install boto3","lang":"bash","label":"Install runtime dependency (if not already present)"},{"cmd":"pip install mypy","lang":"bash","label":"Install type checker (if not already present)"}],"dependencies":[{"reason":"This library provides type stubs for boto3; boto3 itself is required at runtime for your application.","package":"boto3"},{"reason":"May be a transitive dependency or explicitly required by the builder for compatibility with older Python versions.","package":"typing-extensions","optional":true}],"imports":[{"note":"The typed client must be imported from the mypy-boto3 package, not directly from boto3's runtime package.","wrong":"from boto3.client import NeptuneDataClient","symbol":"NeptuneDataClient","correct":"from mypy_boto3_neptunedata.client import NeptuneDataClient"},{"note":"Type definitions are specific to the mypy-boto3 stubs and reside in the .type_defs submodule.","wrong":"from boto3.neptunedata.type_defs import ListGremlinQueriesOutputTypeDef","symbol":"ListGremlinQueriesOutputTypeDef","correct":"from mypy_boto3_neptunedata.type_defs import ListGremlinQueriesOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_neptunedata.client import NeptuneDataClient\nfrom mypy_boto3_neptunedata.type_defs import (\n    ListGremlinQueriesOutputTypeDef,\n    GremlinQueryStatusTypeDef\n)\nimport os\n\ndef get_neptune_query_status() -> ListGremlinQueriesOutputTypeDef:\n    \"\"\"\n    Demonstrates using typed boto3 client for NeptuneData service.\n    Requires 'boto3' and 'mypy-boto3-neptunedata' installed.\n    \"\"\"\n    # Create a typed NeptuneData client\n    client: NeptuneDataClient = boto3.client(\n        \"neptunedata\",\n        region_name=os.environ.get(\"AWS_REGION\", \"us-east-1\")\n    )\n\n    # Example: List active Gremlin queries\n    # The return type will be correctly inferred as ListGremlinQueriesOutputTypeDef\n    response = client.list_gremlin_queries(\n        includeWaitingQueries=True\n    )\n\n    # Type checking ensures correct access to dictionary keys and values\n    for query in response.get(\"queries\", []):\n        status: GremlinQueryStatusTypeDef = query.get(\"status\")\n        query_id: str = query.get(\"queryId\")\n        print(f\"Query ID: {query_id}, Status: {status}\")\n\n    return response\n\n# To type-check this code, run `mypy your_script.py`\n# To run this code, ensure AWS credentials are configured for your environment.\n# if __name__ == \"__main__\":\n#     try:\n#         result = get_neptune_query_status()\n#         print(f\"Listed {len(result.get('queries', []))} queries.\")\n#     except Exception as e:\n#         print(f\"Error calling NeptuneData: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a type-hinted `boto3` client for the NeptuneData service and use it with type-safe operations. It highlights how response structures are automatically typed, allowing for static analysis by `mypy`. Remember that `boto3` itself needs to be installed, and AWS credentials configured for actual execution."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. For older Python versions, use an older `mypy-boto3-neptunedata` release (e.g., from builder < 8.12.0).","message":"Support for Python 3.8 was removed. Projects requiring type annotations for `boto3` will need to upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and packages generated by it, including mypy-boto3-neptunedata 1.42.x)"},{"fix":"Ensure your `mypy` and environment are up-to-date. If issues arise, verify `mypy`'s `package_data` or `namespace_packages` configuration.","message":"The builder migrated to PEP 561 compliant packages. While beneficial, this might impact how `mypy` or other tooling discovers and processes these stubs if they relied on specific older package structures or `mypy` configurations.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your code for direct imports of specific `*_RequestTypeDef` or `*_ExtraRequestTypeDef` names and adjust to the new naming conventions if they clash. Consult the generated stub files for the correct names.","message":"TypeDefs for packed method arguments use shorter names if possible, and conflicting TypeDef `Extra` postfix moved to the end. This can break code that directly imported or referenced these specific TypeDef names.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Ensure `pip install boto3` is part of your project's dependencies.","message":"This library provides type stubs only. You must also install the `boto3` runtime library for your application to function at runtime. `mypy-boto3-neptunedata` is not a replacement for `boto3`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update both `boto3` and `mypy-boto3-neptunedata` to their latest compatible versions. The `mypy-boto3` documentation often provides guidance on version compatibility.","message":"For optimal type checking accuracy, the `mypy-boto3-neptunedata` package version should ideally align closely with your installed `boto3` version. Significant version mismatches can lead to incorrect type hints due to API differences.","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"}