Skip to content
项目

关于

用于访问 Obsidian 笔记的 Python 接口

效率与自动化

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

py-obsidianmd

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

Presentation video

Watch the video

Quickstart

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)

move metadata between frontmatter and inline

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()

regroup inline metadata inside a callout

notes.update_content(inline_inplace=False, inline_position="top", inline_tml="callout") #type: ignore
notes.write()

add and remove metadata

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()

License

BSD 3

Contributing

Contributions are welcome ! Different ways you can contribute:

  • Write an issue: report a bug, suggest an enhancement, ...
  • Submit a pull request to solve an open issue

For more details, see the contribution guidelines.

Support

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 !


探索相关项目

加载中…