Library for Managing your Obsidian Vault
Project description
OVault
A python library for accessing and editing your Obsidian vault.
Check out the examples!
Install
pip install ovault
or locally
git pull https://github.com/BalderHolst/ovault
cd ovault
pip install .
Example
import ovault
# Open a vault at a given path
vault = ovault.Vault("test-vaults/simple_vault")
print()
print("Vault Path :", vault.path)
print("Notes :", len(vault.notes()))
print("Attachments :", len(vault.attachments()))
print("Tags :", sorted(vault.tags()))
print()
# Get the note named 'first_note'
note = vault.note("first_note")
print("Note Name :", note.name)
print("Note Path :", note.path)
print("Note Tokens :", note.tokens())
Output:
Vault Path : /home/balder/projects/ovault/test-vaults/simple_vault
Notes : 11
Attachments : 0
Tags : ['callout4youtag', 'frontmatter-tag1', 'frontmatter-tag2', 'linksaregood']
Note Name : first_note
Note Path : first_note.md
Note Tokens : [Header(# FIRST NOTE!), Text(Wuhuuuuuuuuuuu!Thi...), InternalLink(second note), Text(.Takes a look at t...), InternalLink(sub/todo), Text()]
Features
Vault Management
Indexing
- Indexing: Automatically indexes all notes and attachments within the vault upon initialization.
- Ignored Files: Respects and parses
.vault-ignorefiles to exclude specified paths during indexing. - Dangling Links: Identify and list links within your notes that point to non-existent files.
Note Handling
Access & Properties
- Access Notes & Attachments: Retrieve all notes or attachments in the vault as Python objects.
- Frontmatter Extraction: Manipulate YAML frontmatter from notes.
Modification
- Dynamic Note Modification: Programmatically insert or replace parts of a note
Tag Management
Querying Tags
- List All Tags: Get a complete list of tags present in your vault.
- Filter by Tag: Retrieve all notes associated with a specific tag.
Markdown Parsing & Tokenization
Token Representation
- Rich Token Representation: Notes are parsed into a detailed stream of
Tokenobjects, representing various markdown elements. - Available Tokens:
- Plain Text: This is text
- Headers: (
# Heading) - Internal Links: (
[[Note Name]],![[Image.png]]) - External Links: (
[link text](url),) - Tags: (
#tag) - Code Blocks: (fenced code,
inline code) - Quotes: (
> Quote) - Math: (
$inline$and$$display$$LaTeX) - Dividers: (
---) - Callouts: (
> [!type] Title) - Frontmatter: (YAML metadata)
- List:
- item 1\n- item 2 - NumericList:
1. first\n2. second - CheckList:
- [x] done\n- [ ] not done - TemplaterCommand: (
<% code goes here %>)
See lexer/tokens.rs for token definitions.
Contributing
I would be more than happy if anyone finds this useful enough to add to, or modify this code.
Development
Install ovault and development dependencies with
pip install -e ".[dev]"
or use the nix flake
nix develop
Build for Testing
maturin develop --release --features python
Test
./test.sh
Build Documentation
./docs/build.py
Release
- Bump version in
Cargo.toml - Commit change and push
- Merge
devintomainand push - Create a git tag with the same version:
git tag <version> - Push new tag:
git push --tags
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovault-0.0.6-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: ovault-0.0.6-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 529.3 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e007345e2aedeefe33f44489533a36da7fed9e2fc13a210783e763a500648b7
|
|
| MD5 |
8b73ef2fce9b84314d73b72208ec6a13
|
|
| BLAKE2b-256 |
594cbc3077df878ab29be0688bd26a44d9f790755466156e1ba7f0bdef42ac68
|
Provenance
The following attestation bundles were made for ovault-0.0.6-cp37-abi3-win_amd64.whl:
Publisher:
release.yaml on BalderHolst/ovault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ovault-0.0.6-cp37-abi3-win_amd64.whl -
Subject digest:
3e007345e2aedeefe33f44489533a36da7fed9e2fc13a210783e763a500648b7 - Sigstore transparency entry: 533567613
- Sigstore integration time:
-
Permalink:
BalderHolst/ovault@5e93e0aa84d35465a7535abc5bb32d701d252e83 -
Branch / Tag:
refs/tags/0.0.6 - Owner: https://github.com/BalderHolst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@5e93e0aa84d35465a7535abc5bb32d701d252e83 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ovault-0.0.6-cp37-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: ovault-0.0.6-cp37-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 697.4 kB
- Tags: CPython 3.7+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a00909e1bf1f81e5897fff9f785cfc8a53e93ae33bc9666c07436b1770b4097
|
|
| MD5 |
ee8266330ff3705a55ed67480decc095
|
|
| BLAKE2b-256 |
b207557a0e7791dd975dd1d20717d3f1e2cd642a7faf1db249f8cd0ed57cdac9
|
Provenance
The following attestation bundles were made for ovault-0.0.6-cp37-abi3-manylinux_2_34_x86_64.whl:
Publisher:
release.yaml on BalderHolst/ovault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ovault-0.0.6-cp37-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
2a00909e1bf1f81e5897fff9f785cfc8a53e93ae33bc9666c07436b1770b4097 - Sigstore transparency entry: 533567615
- Sigstore integration time:
-
Permalink:
BalderHolst/ovault@5e93e0aa84d35465a7535abc5bb32d701d252e83 -
Branch / Tag:
refs/tags/0.0.6 - Owner: https://github.com/BalderHolst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@5e93e0aa84d35465a7535abc5bb32d701d252e83 -
Trigger Event:
push
-
Statement type: