MCPcopy
hub / github.com/HKUDS/LightRAG / export_data

Function export_data

lightrag/utils.py:3354–3392  ·  view source on GitHub ↗

Synchronously exports all entities, relations, and relationships to various formats. Args: chunk_entity_relation_graph: Graph storage instance for entities and relations entities_vdb: Vector database storage for entities relationships_vdb: Vector database storage fo

(
    chunk_entity_relation_graph,
    entities_vdb,
    relationships_vdb,
    output_path: str,
    file_format: str = "csv",
    include_vector_data: bool = False,
)

Source from the content-addressed store, hash-verified

3352
3353
3354def export_data(
3355 chunk_entity_relation_graph,
3356 entities_vdb,
3357 relationships_vdb,
3358 output_path: str,
3359 file_format: str = "csv",
3360 include_vector_data: bool = False,
3361) -> None:
3362 """
3363 Synchronously exports all entities, relations, and relationships to various formats.
3364
3365 Args:
3366 chunk_entity_relation_graph: Graph storage instance for entities and relations
3367 entities_vdb: Vector database storage for entities
3368 relationships_vdb: Vector database storage for relationships
3369 output_path: The path to the output file (including extension).
3370 file_format: Output format - "csv", "excel", "md", "txt".
3371 - csv: Comma-separated values file
3372 - excel: Microsoft Excel file with multiple sheets
3373 - md: Markdown tables
3374 - txt: Plain text formatted output
3375 include_vector_data: Whether to include data from the vector database.
3376 """
3377 try:
3378 loop = asyncio.get_event_loop()
3379 except RuntimeError:
3380 loop = asyncio.new_event_loop()
3381 asyncio.set_event_loop(loop)
3382
3383 loop.run_until_complete(
3384 aexport_data(
3385 chunk_entity_relation_graph,
3386 entities_vdb,
3387 relationships_vdb,
3388 output_path,
3389 file_format,
3390 include_vector_data,
3391 )
3392 )
3393
3394
3395def lazy_external_import(module_name: str, class_name: str) -> Callable[..., Any]:

Callers

nothing calls this directly

Calls 1

aexport_dataFunction · 0.85

Tested by

no test coverage detected