Skip to content

Core

Graph analytics executor and data types.

ColumnNameByTableName module-attribute ¤

ColumnNameByTableName = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].dataframes[].<table_name>.columns[]'}]

A type annotation to be used for parameters of an operation. ColumnNameByTableName is rendered as a dropdown in the frontend, listing the columns of the DataFrame named by the "table_name" parameter. The column name is passed to the operation as a string.

EdgePropertyName module-attribute ¤

EdgePropertyName = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].dataframes[].edges[].columns[]'}]

A type annotation to be used for parameters of an operation. EdgePropertyName is rendered as a dropdown in the frontend, listing the columns of the "edges" DataFrame. The column name is passed to the operation as a string.

NodePropertyName module-attribute ¤

NodePropertyName = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].dataframes[].nodes[].columns[]'}]

A type annotation to be used for parameters of an operation. NodePropertyName is rendered as a dropdown in the frontend, listing the columns of the "nodes" DataFrame. The column name is passed to the operation as a string.

OtherName module-attribute ¤

OtherName = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].other.keys(@)[]'}]

A type annotation to be used for parameters of an operation. OtherName is rendered as a dropdown in the frontend, listing the keys on the "other" part of the Bundle. The key is passed to the operation as a string.

RecordsColumn module-attribute ¤

RecordsColumn = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].dataframes[].records.columns[]'}]

A type annotation to be used for parameters of an operation. RecordsColumn is rendered as a dropdown in the frontend, listing the columns of the "records" DataFrame. The column name is passed to the operation as a string.

TableColumn module-attribute ¤

TableColumn = Annotated[tuple[str, str], {'format': 'double-dropdown', 'metadata_query1': '[].dataframes[].keys(@)[]', 'metadata_query2': '[].dataframes[].<first>.columns[]'}]

A type annotation to be used for parameters of an operation. TableColumn is rendered as a pair of dropdowns for selecting a table in the Bundle and a column inside of that table. Effectively "TableName" and "ColumnNameByTableName" combined. The selected table and column name is passed to the operation as a 2-tuple of strings.

TableName module-attribute ¤

TableName = Annotated[str, {'format': 'dropdown', 'metadata_query': '[].dataframes[].keys(@)[]'}]

A type annotation to be used for parameters of an operation. TableName is rendered as a dropdown in the frontend, listing all DataFrames in the Bundle. The table name is passed to the operation as a string.

RedirectToCurrentUrlService ¤

Bases: Service

Temporary redirect used while Gradio routes are being mounted.

Service ¤

Bases: Protocol

get async ¤

get(request: Request) -> dict

Handles a GET request. The unparsed part of the URL is available as request.state.remaining_path.

post async ¤

post(request: Request) -> dict

Handles a POST request. The unparsed part of the URL is available as request.state.remaining_path.

api_service_get async ¤

api_service_get(request)

Boxes can expose HTTP endpoints.

Example

... class ChatBackend: def get(self, request: fastapi.Request): return f"Hello from {request.state.remaining_path}" def post(self, request: fastapi.Request): print("POST received for", request.state.remaining_path) @op("Chat backend", outputs=[], view="service") def chat_backend(input: Bundle): return ChatBackend()

curl ${LYNXKITE_URL}/api/service/lynxkite_graph_analytics/Example.lynxkite.json/Chat%20backend%201/models

disambiguate_edges ¤

disambiguate_edges(ws: Workspace)

If an input plug is connected to multiple edges, keep only the last edge.

nx_node_attribute_func ¤

nx_node_attribute_func(name)

Decorator for wrapping a function that adds a NetworkX node attribute.