Download src/utils/er_diagram.py from maikheb/nl2sql: direct link, hf CLI and curl.
- Browser
- Download file 254 Bytes
-
https://huggingface.co/spaces/maikheb/nl2sql/resolve/main/src/utils/er_diagram.py
- Command line
-
hf download hf://spaces/maikheb/nl2sql/src/utils/er_diagram.py
-
curl -L -o er_diagram.py https://huggingface.co/spaces/maikheb/nl2sql/resolve/main/src/utils/er_diagram.py
254 Bytes
| from graphviz import Digraph | |
| def render_er_diagram(schema_dict): | |
| dot = Digraph() | |
| for table, cols in schema_dict.items(): | |
| col_str = "\n".join(cols) | |
| dot.node(table, f"{table}\n{col_str}", shape="box") | |
| return dot.source | |