CLI utility to generate and manipulate graphs of links in a PKM/Obsidian-style notebook
- Python 100%
| src/notegraph | fixed use of cli flags | |
| .gitignore | gitignore/pyproject | |
| LICENSE | initial commit | |
| pdm.lock | working cli tool | |
| pyproject.toml | gitignore/pyproject | |
| README.md | updated cli flags | |
README
CLI utility to generate and manipulate graphs of links in a PKM/Obsidian-style notebook
Installing
To install with pipx:
pipx install git+https://codeberg.org/reillypascal/notegraph.git
Configuration
notegraph looks for a configuration file at ~/.config/notegraph/config.toml. Example configuration:
[paths]
input = "path/to/notes/directory"
Usage
-h,--helpshow this help message and exit-i,--inputfolder of notes to parse; set default in$XDG_CONFIG_HOME/notegraph-o,--outputoutput file for Graphviz graph (default: './graph.gv')-d,--depthdepth at which to find neighbors (default: 1)-g,--graphoutput Graphviz graph-l,--listlist notes with link counts: optional positive n shows n most-linked, and negative n shows n least-linked-n,--neighborsfind neighbors of note, given note title-O,--orphansfind orphaned notes (notes with no links)-r,--reversereverse order of sorted link counts
Generating Graph Images
This tool outputs a Graphviz (.gv/.dot) file. To convert the file to a PNG image, run the following:
# layered graph
dot -Tpng graph.gv -o graph.png
Graphviz also provides the following commands to create force-directed graphs. Note that these are mostly useful for smaller and/or sparser graphs:
# force-directed graph
fdp -Tpng graph.gv -o graph.png
# multiscale force-directed graph; good for large graphs
sfdp -Tpng graph.gv -o graph.png