README file from
GithubPython Panel
An Obsidian plugin that adds a sidebar panel of buttons for running Python scripts located in your vault.
Features
- Sidebar panel — opens automatically on startup, with one button per configured script
- Script buttons — click a button to run the corresponding Python script; the button shows a running state while the script executes
- Status feedback — success/error notices after each run, including a
Done. ...summary line if the script prints one - Separators and group labels — organize buttons with horizontal rules or
--- Group Nameheadings - Auto Python detection — finds Python automatically (tries
python3,python, thenpy) - Selection scripts — scripts named
reflow_prose_selection.py(orreflow-prose-selection.py) receive the current editor selection and replace it with the script output - Commands — Open sidebar and Open latest weekly note
- Settings tab — add, edit, reorder, and remove scripts and separators
Requirements
- Obsidian 1.13.0 or later (desktop only — the plugin launches Python as a child process, which the mobile app does not support)
- Python 3.x installed and available on
PATH
Installation
Download main.js, manifest.json, and styles.css from the latest release and copy them into your vault's plugin folder:
<your vault>/.obsidian/plugins/python-panel/
Create the python-panel folder if it doesn't exist. Then enable the plugin:
- Go to Settings → Community plugins
- Find Python Panel and enable it
- The sidebar opens automatically; reopen it any time with the calendar-clock ribbon icon or the Open Python Panel command
Configuration
Go to Settings → Python Panel to add, edit, reorder, and remove scripts. Script paths are relative to your vault root.
Separators
Use separators to visually group scripts in the sidebar:
- Click Add Separator in settings to insert a divider
- Plain
---renders as a horizontal line - Edit the text to
--- Group Nameto render a labeled group heading - Use the up/down arrow buttons to reorder separators alongside scripts
Separator entries are stored right in the scripts list, so you can also edit data.json directly:
"scripts": [
"software/python/obsidian-scripts/script-a.py",
"--- Review",
"software/python/obsidian-scripts/script-b.py",
"---",
"software/python/obsidian-scripts/script-c.py"
]
Usage
- Open the Python Panel sidebar (calendar-clock ribbon icon, or the Open Python Panel command)
- Click a script button to run it
- Wait for the script to complete (the button shows a running state)
- Check the status message / notice for success or error feedback
Scripts run with the vault root as the working directory. The active note's absolute path is passed to the script in the OBSIDIAN_ACTIVE_FILE environment variable.
Selection scripts
For reflow-style tools (e.g. reflow_prose_selection.py), select text in the open note first, then click the button. The plugin passes the selection to Python and replaces it in the editor — no clipboard shortcuts involved. The selection is passed via the OBSIDIAN_SELECTION_IN / OBSIDIAN_SELECTION_OUT file paths in the environment.
Building from source
With Node.js installed:
npm install
npm run build # writes main.js to this folder (repo root)
For development with watch mode:
npm run dev
On Windows without Node/npm, use the standalone build script (downloads tools/esbuild.exe on first run):
.\build.ps1
The script builds main.js in the repo root and copies main.js, manifest.json, and styles.css into ../../../.obsidian/plugins/python-panel (relative to this folder), ready to reload in Obsidian.