### Install py-obsidianmd using pip Source: https://github.com/selimrbd/py-obsidianmd/blob/main/docs/docs/index.md This command installs the py-obsidianmd library using the Python package installer (pip). Ensure you have Python and pip installed on your system. ```bash pip install py-obsidianmd ``` -------------------------------- ### Initialize Notes Object in Python Source: https://github.com/selimrbd/py-obsidianmd/blob/main/docs/docs/examples.md Demonstrates how to create a 'Notes' object by specifying the path to an Obsidian vault directory. It also shows how to create a single 'Note' object for modifying a specific file. Requires the 'pathlib' and 'pyomd' libraries. ```python from pathlib import Path from pyomd import Notes, Note path_dir = Path("/path/to/your/directory") notes = Notes(path_dir) ## You can also create a single note object, if you only need to modify 1 note # note = Note(path_dir) ``` -------------------------------- ### Move Metadata Between Frontmatter and Inline in Python Source: https://github.com/selimrbd/py-obsidianmd/blob/main/docs/docs/examples.md Shows how to move metadata between frontmatter and inline formats within Obsidian notes using the py-obsidianmd library. It includes updating content with inline metadata at the top and writing changes. Requires the 'pyomd' library and the 'MetadataType' enum. ```python 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() ``` -------------------------------- ### Add and Remove Metadata in Python Source: https://github.com/selimrbd/py-obsidianmd/blob/main/docs/docs/examples.md Demonstrates adding and removing metadata (like tags) from Obsidian notes using the py-omd library. It filters notes, adds a 'type' metadata, removes a specific tag, and updates the content with callout formatting. Requires the 'pyomd' library and 'MetadataType'. ```python 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() ``` -------------------------------- ### Regroup Inline Metadata Inside a Callout in Python Source: https://github.com/selimrbd/py-obsidianmd/blob/main/docs/docs/examples.md Illustrates how to regroup inline metadata within a callout block in Obsidian notes using the py-obsidianmd library. It updates the content to use the 'callout' format for inline metadata and writes the changes. Requires the 'pyomd' library. ```python notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore notes.write() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.