A lightweight, persistent graph database with a command-line interface for creating, managing, and visualizing graphs.
GraphDBLite allows you to:
- Create directed/undirected and weighted/unweighted graphs
- Add and remove nodes and edges
- List and describe graphs
- Save graphs to disk and load them back
- Persistent storage with automatic graceful shutdown
- Clone the repository
- Install dependencies:
pip install -e .Create a .env file in the project root:
SAVE_FILE_PATH=/path/to/your/graphs.json
This variable specifies where all graphs will be saved by default.
python main.pyCREATE GRAPH <alias> [DIRECTED] [WEIGHTED]- Create a new graphLIST GRAPHS- List all graphsDESCRIBE GRAPH <alias>- Show graph propertiesLOAD GRAPH <filename>- Load graph from fileSAVE GRAPH <alias> <filename>- Save graph to file
ADD NODE <graph_alias> <node_name>- Add a node to graphDEL NODE <graph_alias> <node_name>- Delete a node from graphLIST NODES <graph_alias>- List all nodes in graph
ADD EDGE <graph_alias> <node1> <node2> [weight]- Add an edgeDEL EDGE <graph_alias> <node1> <node2> [weight]- Delete an edgeLIST EDGES <graph_alias> [node1] [node2]- List edges
HELP- Show helpCLEAR- Clear screenEXIT- Exit application
CREATE GRAPH social DIRECTED
ADD NODE social alice
ADD NODE social bob
ADD EDGE social alice bob 5
LIST NODES social
DESCRIBE GRAPH social
EXIT
The application automatically saves all graphs to disk when you exit using EXIT or Ctrl+C. No data is lost.