A python library for modifying Obsidian notes in batch.
See the full documentation
:warning: Consider backing up your vault before using the library, to avoid any risk of data loss. You can test the library on this example vault
pip install py-obsidianmd
from pathlib import Path
from pyomd import Notes
from pyomd.metadata import MetadataType
path_dir = Path('/path/to/obsidian/folder')
notes = Notes(path_dir)
notes.metadata.move(fr=MetadataType.FRONTMATTER, to=MetadataType.INLINE)
notes.update_content(inline_inplace=False, inline_position="top", inline_tml="standard") #type: ignore
notes.write()
notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore
notes.write()
notes.filter(has_meta=[("tags", "type/book", MetadataType.INLINE)])
notes.metadata.add(k="type", l="[[book]]", meta_type=MetadataType.INLINE)
notes.metadata.remove(k="tags", l="type/book", meta_type=MetadataType.INLINE)
notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore
notes.write()
Contributions are welcome ! Different ways you can contribute:
For more details, see the contribution guidelines.
If you found this library useful and wish to support it's development, you can do so using the links below (paypal or Ko-fi). Thanks a bunch !