mypy-boto3-neptune-graph Type Stubs
mypy-boto3-neptune-graph provides type annotations for the AWS NeptuneGraph service client in boto3, ensuring type-safe AWS interactions with MyPy. It is part of the larger `mypy-boto3` collection, automatically generated by `mypy-boto3-builder` version 8.12.0, and is currently at version 1.42.43. The `mypy-boto3` ecosystem follows a regular release cadence, often aligning with new boto3 service releases or builder improvements.
Warnings
- breaking Support for Python 3.8 has been removed in `mypy-boto3-builder` 8.12.0. Users on Python 3.8 must either upgrade their Python version or use an older `mypy-boto3-builder` version if possible.
- breaking All `mypy-boto3` packages, including `mypy-boto3-neptune-graph`, migrated to PEP 561-compliant packages in `mypy-boto3-builder` 8.12.0. This means type checkers should automatically discover them, but in rare cases, custom `mypy` configurations might need adjustment if they previously relied on non-standard stub locations.
- breaking From `mypy-boto3-builder` 8.9.0, some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes moved (`CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). While this specific service might not be directly affected, it's a general breaking change in the builder that could alter type definition names.
- gotcha This package provides only type stubs. It does NOT include `boto3` or `botocore` libraries, which are required for runtime execution. You must install `boto3` separately.
- gotcha For type checking, you need to run `mypy` or another compatible static type checker. Installing this package alone does not perform type checking automatically.
Install
-
pip install mypy-boto3-neptune-graph
Imports
- NeptuneGraphClient
from mypy_boto3_neptune_graph.client import NeptuneGraphClient
- NeptuneGraphServiceResource
from mypy_boto3_neptune_graph.service_resource import NeptuneGraphServiceResource
Quickstart
import boto3
from mypy_boto3_neptune_graph.client import NeptuneGraphClient
from botocore.exceptions import ClientError
def get_neptune_graph_client() -> NeptuneGraphClient:
"""Gets a type-annotated NeptuneGraph client."""
try:
client: NeptuneGraphClient = boto3.client("neptune-graph")
# Example usage: list graphs (requires appropriate permissions)
# response = client.list_graphs()
# print(f"Graphs: {response.get('graphs')}")
return client
except ClientError as e:
print(f"Error creating NeptuneGraph client: {e}")
raise
if __name__ == "__main__":
neptune_client = get_neptune_graph_client()
print(f"NeptuneGraph client type: {type(neptune_client)}")