orgroamtools
is a Python library to assist in data analysis of org-roam
collection, written in as close to pure Python as possible.
It can pull various bits of information out of your org-roam
, including some body-text based information like source blocks and LaTeX snippets.
The information you extract about the natural graph structure of your collection can be used for many types of exploratory data analysis involving graph neural networks, natural language processing, and topological data analysis.
To use it, all you need is a healthy org-roam v2
database!
Take a minute to locate the database by inspecting the value of (org-roam-db-location)
in Emacs, then make sure it is up to date by running (org-roam-db-sync)
.
Install the library, putting it in a virtual environment if desired:
python -m pip install orgroamtools
Import the library and pass in your database path:
from orgroamtools.data import RoamGraph
collection = RoamGraph(PATH_TO_ORG_ROAM_DB)
You can extract the graph structure via adjacency lists for use in graph data analysis methods like GNNs and TDA:
graph = collection.adjacency_list
Or you can extract the body texts of the nodes for text preprocessing for NLP:
node_bodies = collection.body_index
Full documentation of functions and features for the library can be read here.
- Python 3.10+
networkx
: a graph analysis library for Pythonorgparse
: a Python library for parsingorg-mode
files
obsidiantools