You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-12
Original file line number
Diff line number
Diff line change
@@ -4,50 +4,52 @@
4
4
# obsidiantools 🪨⚒️
5
5
**obsidiantools** is a Python package for getting structured metadata about your [Obsidian.md notes](https://obsidian.md/) and analysing your vault. Complement your Obsidian workflows by getting metrics and detail about all your notes in one place through the widely-used Python data stack.
6
6
7
-
It's incredibly easy to explore structured data on your vault through this fluent interface. This is all the code you need to generate a `vault` object that stores the key data:
7
+
It's incredibly easy to explore structured data on your vault through this fluent interface. This is all the code you need to generate a `vault` object that stores all the data:
-`connect()`: connect your notes together in a graph structure and get metadata on links (e.g. wikilinks, backlinks, etc.)
15
+
These are the basics of the method calls:
16
+
-`connect()`: connect your notes together in a graph structure and get metadata on links (e.g. wikilinks, backlinks, etc.) There ais the option to support the inclusion of 'attachment' files in the graph.
17
17
-`gather()`: gather the plaintext content from your notes in one place. This includes the 'source text' that represent how your notes are written. There are arguments to support what text you want to remove, e.g. remove code.
18
18
19
19
See some of the **key features** below - all accessible from the `vault` object either through a method or an attribute.
20
20
21
-
As this package relies upon note (file)names, it is only recommended for use on vaults where wikilinks are not formatted as paths and where note names are unique. This should cover the vast majority of vaults that people create.
21
+
The package is built to support the 'shortest path when possible' option for links. This should cover the vast majority of vaults that people create. See the [wiki](https://github.com/mfarragher/obsidiantools/wiki) for more info on what sort of wikilink syntax is not well-supported and how the graph may be slightly different to what you see in the Obsidian app.
22
22
23
23
## 💡 Key features
24
24
This is how **`obsidiantools`** can complement your workflows for note-taking:
25
25
-**Access a `networkx` graph of your vault** (`vault.graph`)
26
26
- NetworkX is the main Python library for network analysis, enabling sophisticated analyses of your vault.
27
27
- NetworkX also supports the ability to export your graph to other data formats.
28
28
- When instantiating a `vault`, the analysis can also be filtered on specific subdirectories.
29
-
-**Get summary stats about your notes, e.g. number of backlinks and wikilinks, in a Pandas dataframe**
30
-
- Get the dataframe via `vault.get_note_metadata()`
29
+
-**Get summary stats about your notes & files, e.g. number of backlinks and wikilinks, in a Pandas dataframe**
30
+
- Get the dataframe via `vault.get_note_metadata()` (notes / md files), `vault.get_media_file_metadata()` (media files that can be embedded in notes) and `vault.get_canvas_file_metadata()` (canvas files).
31
31
-**Retrieve detail about your notes' links and metadata as built-in Python types**
32
+
- The main indices of files are `md_file_index`, `media_file_index` and `canvas_file_index` (canvas files).
33
+
- Check whether files included as links in the vault actually exist, via `vault` attributes like `nonexistent_notes`, `nonexistent_media_files` and `nonexistent_canvas_files`.
34
+
- Check whether actual files are isolated in the graph ('orphans'), via `vault` attributes like `isolated_notes`, `isolated_media_files` and `isolated_canvas_files`.
35
+
- You can access all the note & file links in one place, or you can load them for an individual note:
36
+
- e.g. `vault.backlinks_index` for all backlinks in the vault
37
+
- e.g. `vault.get_backlinks(<NOTE>)` for the backlinks of an individual note
32
38
-**md note info:**
33
39
- The various types of links:
34
40
- Wikilinks (incl. header links, links with alt text)
35
41
- Embedded files
36
42
- Backlinks
37
43
- Markdown links
38
-
- You can access all the links in one place, or you can load them for an individual note:
39
-
- e.g. `vault.backlinks_index` for all backlinks in the vault
40
-
- e.g. `vault.get_backlinks(<NOTE>)` for the backlinks of an individual note
41
44
- Front matter via `vault.get_front_matter(<NOTE>)` or `vault.front_matter_index`
42
45
- Tags via `vault.get_tags(<NOTE>)` or `vault.tags_index`. Nested tags are supported.
43
46
- LaTeX math via `vault.get_math(<NOTE>)` or `vault.math_index`
44
-
- Check which notes are isolated (`vault.isolated_notes`)
45
-
- Check which notes do not exist as files yet (`vault.nonexistent_notes`)
46
47
- As long as `gather()` is called:
47
48
- Get source text of note (via `vault.get_source_text(<NOTE>)`). This tries to represent how a note's text appears in Obsidian's 'source mode'.
48
49
- Get readable text of note (via `vault.get_readable_text(<NOTE>)`). This tries to reduce note text to minimal markdown formatting, e.g. preserving paragraphs, headers and punctuation. Only slight processing is needed for various forms of NLP analysis.
49
50
-**canvas file info:**
50
51
- The JSON content of each canvas file is stored as a Python dict in `vault.canvas_content_index`
52
+
- Data to recreate the layout of content in a canvas file via the `vault.canvas_graph_detail_index` dict
51
53
52
54
Check out the functionality in the demo repo. Launch the '15 minutes' demo in a virtual machine via Binder:
53
55
@@ -58,7 +60,7 @@ There are other API features that try to mirror the Obsidian.md app, for your co
58
60
The text from vault notes goes through this process: markdown → split out front matter from text → HTML → ASCII plaintext.
0 commit comments