A minimal Python script to bulk-apply a Markdown template to all notes in an Obsidian folder.
Useful when you want to standardize a set of notes (Hub pages, MOCs, indexes) with a consistent structure while preserving each note's individual title.
- Read a template file you designed in Obsidian.
- Loop through every
.mdfile in the target folder. - Replace every
{{Title}}placeholder with the note's filename (without extension). - Overwrite the note with the result.
- Python 3.6 or later
- No third-party dependencies
Run the script from the root of your Obsidian vault:
python bulk_edit_from_template.pyBy default it reads Template/Hub.md and updates all notes in 7_Hubs/Enterprise. Override either path with flags:
python bulk_edit_from_template.py --template "Templates/MyTemplate.md" --target "Hubs"python bulk_edit_from_template.py --dry-runPrints which files would be updated without touching anything on disk.
Your template can contain any Markdown content. Use {{Title}} where you want the note's filename inserted:
# {{Title}}
## Overview
## Resources
## Links| Argument | Default | Description |
|---|---|---|
--template |
Template/Hub.md |
Path to the template file |
--target |
7_Hubs/Enterprise |
Folder containing notes to update |
--dry-run |
off | Preview changes without writing |
This script overwrites every note in the target folder. Back up your vault before running, or use --dry-run first to review what will change.
MIT License. See LICENSE.