CSV edge list
Simplest format. One edge per row; nodes are derived from the set of source / target ids. No per-node properties — use CSV pair if you need those.
Minimum viable example
Section titled “Minimum viable example”source,target,weightalice,bob,0.8bob,carol,1.2alice,carol,0.5TSV works identically — save with tab separators and rename to .tsv.
Columns
Section titled “Columns”Headers are case-insensitive. Only the four columns below are read; any others are dropped silently.
| Column | Required | Notes |
|---|---|---|
source | yes | Node id (any non-empty string). |
target | yes | Node id. |
weight | no | Parsed as a number. Non-numeric values are dropped with a warning; the edge still loads without a weight. |
Coming from another tool
Section titled “Coming from another tool”Pandas
Section titled “Pandas”# edges_df has whatever columns your pipeline produced; rename to Knotviz's# required column names, keep weight if you have it, drop everything else.(edges_df .rename(columns={"src": "source", "dst": "target", "w": "weight"}) [["source", "target", "weight"]] .to_csv("edges.csv", index=False))PostgreSQL
Section titled “PostgreSQL”psql -d mydb -c "\copy ( SELECT source_id AS source, target_id AS target, weight FROM edges) TO 'edges.csv' CSV HEADER"NetworkX
Section titled “NetworkX”import csv, networkx as nxwith open("edges.csv", "w", newline="") as f: w = csv.writer(f) w.writerow(["source", "target", "weight"]) for u, v, data in G.edges(data=True): w.writerow([u, v, data.get("weight", 1)])Excel / Google Sheets
Section titled “Excel / Google Sheets”Save As → CSV (UTF-8). Headers must include source and target. An optional weight column works as-is.
Gotchas
Section titled “Gotchas”- No per-node properties. The edge list can’t attach
age,community, tags, etc. to nodes. If you need that, switch to CSV pair. - Typed headers don’t apply here. Writing
weight:numberorage:numberwon’t parse the way it does in CSV pair — the column name is checked literally, and anything that isn’t one ofsource/target/weightis ignored. - Nodes are auto-created from every id appearing in
sourceortarget. You can’t “pre-declare” a node — if you want isolated nodes (with no edges), use CSV pair or JSON. - Quoted cells follow RFC 4180 — commas and newlines inside
"..."are preserved. - UTF-8 only. A BOM (Excel’s default when exporting UTF-8) is handled automatically.