Examples#
Index > NeptuneGraph > Examples
Auto-generated documentation for NeptuneGraph type annotations stubs module types-boto3-neptune-graph.
Client#
Implicit type annotations#
Can be used with types-boto3[neptune-graph]
package installed.
Write your NeptuneGraph
code as usual,
type checking and code completion should work out of the box.
# NeptuneGraphClient usage example
from boto3.session import Session
session = Session()
client = session.client("neptune-graph") # (1)
result = client.cancel_export_task() # (2)
- client: NeptuneGraphClient
- result: CancelExportTaskOutputTypeDef
# ListExportTasksPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("neptune-graph") # (1)
paginator = client.get_paginator("list_export_tasks") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: NeptuneGraphClient
- paginator: ListExportTasksPaginator
- item: ListExportTasksOutputTypeDef
# ExportTaskCancelledWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("neptune-graph") # (1)
waiter = client.get_waiter("export_task_cancelled") # (2)
waiter.wait()
- client: NeptuneGraphClient
- waiter: ExportTaskCancelledWaiter
Explicit type annotations#
With types-boto3-lite[neptune-graph]
or a standalone types_boto3_neptune_graph
package, you have to explicitly specify client: NeptuneGraphClient
type annotation.
All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.
# NeptuneGraphClient usage example with type annotations
from boto3.session import Session
from types_boto3_neptune_graph.client import NeptuneGraphClient
from types_boto3_neptune_graph.type_defs import CancelExportTaskOutputTypeDef
from types_boto3_neptune_graph.type_defs import CancelExportTaskInputRequestTypeDef
session = Session()
client: NeptuneGraphClient = session.client("neptune-graph")
kwargs: CancelExportTaskInputRequestTypeDef = {...}
result: CancelExportTaskOutputTypeDef = client.cancel_export_task(**kwargs)
# ListExportTasksPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_neptune_graph.client import NeptuneGraphClient
from types_boto3_neptune_graph.paginator import ListExportTasksPaginator
from types_boto3_neptune_graph.type_defs import ListExportTasksOutputTypeDef
session = Session()
client: NeptuneGraphClient = session.client("neptune-graph")
paginator: ListExportTasksPaginator = client.get_paginator("list_export_tasks")
for item in paginator.paginate(...):
item: ListExportTasksOutputTypeDef
print(item)
# ExportTaskCancelledWaiter usage example with type annotations
from boto3.session import Session
from types_boto3_neptune_graph.client import NeptuneGraphClient
from types_boto3_neptune_graph.waiter import ExportTaskCancelledWaiter
session = Session()
client: NeptuneGraphClient = session.client("neptune-graph")
waiter: ExportTaskCancelledWaiter = client.get_waiter("export_task_cancelled")
waiter.wait()