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.
Presentation 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)
You can test the library on this example vault
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
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 !
Release files for py-obsidianmd 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py-obsidianmd-0.1.7.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_obsidianmd-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.0 kB
Release files / py-obsidianmd-0.1.7.tar.gz
| Download URL | py-obsidianmd-0.1.7.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c92ec2f3ba8b776e6c7fa486a3d880b330177be33a29e8f51d79bcc4d78a5a3
|
|
BLAKE2b-256 checksum How to use checksums |
378d436f686e731c1a63c8f5ef55cd68070af12668661a17c7fb75ac72ca2e5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.9.15 Darwin/22.1.0
|
Release files / py_obsidianmd-0.1.7-py3-none-any.whl
| Download URL | py_obsidianmd-0.1.7-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7658c1ccc9502900468076b987e5e449af0e5ce10cb0424e0568f6bd0703acc
|
|
BLAKE2b-256 checksum How to use checksums |
c05efcf1f02a4e56d4919064f72d105d07d3709d268cc003305743717764fd17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.9.15 Darwin/22.1.0
|