Home

Awesome

PyPI version PyPI version Licence Documentation codecov

obsidiantools 🪨⚒️

obsidiantools is a Python package for getting structured metadata about your Obsidian.md notes 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.

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:

import obsidiantools.api as otools

vault = otools.Vault(<VAULT_DIRECTORY>).connect().gather()

These are the basics of the method calls:

See some of the key features below - all accessible from the vault object either through a method or an attribute.

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 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.

💡 Key features

This is how obsidiantools can complement your workflows for note-taking:

Check out the functionality in the demo repo. Launch the '15 minutes' demo in a virtual machine via Binder:

Documentation Binder

There are other API features that try to mirror the Obsidian.md app, for your convenience when working with Python, but they are no substitute for the interactivity of the app!

The text from vault notes goes through this process: markdown → split out front matter from text → HTML → ASCII plaintext.

⏲️ Installation

pip install obsidiantools

Requires Python 3.9 or higher.

🖇️ Dependencies

All of these libraries are needed so that the package can separate note text from front matter in a generalised approach.

🏗️ Tests

A small 'dummy vault' vault of lipsum notes is in tests/vault-stub (generated with help of the lorem-markdownum tool). Sense-checking on the API functionality was also done on a personal vault of over 800 notes.

I am not sure how the parsing will work outside of Latin languages - if you have ideas on how that can be supported feel free to suggest a feature or pull request.

⚖️ Licence

Modified BSD (3-clause)