A QGIS plugin for rendering and running Jupyter notebooks directly within QGIS. The plugin provides a dockable panel interface for interactive notebook execution.
- π Open Notebooks: Load and render Jupyter notebook (.ipynb) files
βΆοΈ Execute Cells: Run Python code cells with syntax highlighting- π Markdown Support: Render markdown cells with headers, lists, links, and formatting
- π¨ Syntax Highlighting: Beautiful Python syntax highlighting for code cells
- π Rich Output: View text, errors, and execution results
- π QGIS Integration: Access QGIS layers, projects, and Python environment
- πΎ Save Notebooks: Save changes back to notebook files
- π Create New: Start fresh notebooks from within QGIS
- βοΈ Customizable: Configure appearance, fonts, and execution settings
- π Auto-Update: Check for and install updates from GitHub
The plugin provides a clean, dark-themed interface that integrates seamlessly with QGIS:
- Notebook Panel: Dockable panel for viewing and executing notebooks
- Settings Panel: Configure plugin behavior and appearance
- Update Checker: Keep the plugin up-to-date
π Run Jupyter Notebooks Directly Inside QGIS! | QGIS Notebook Plugin Tutorial
- Open QGIS
- Go to Plugins β Manage and Install Plugins...
- Go to the Settings tab
- Click Add... under "Plugin Repositories"
- Give a name for the repository, e.g., "OpenGeos"
- Enter the URL of the repository: https://qgis.gishub.org/plugins.xml
- Click OK
- Go to the All tab
- Search for "Notebook"
- Select "Notebook" from the list and click Install Plugin
Clone the repository:
git clone https://github.com/opengeos/qgis-notebook-plugin.git
cd qgis-notebook-pluginInstall the plugin:
# Install the plugin
python install.py
# Remove the plugin
python install.py --remove# Install the plugin
./install.sh
# Remove the plugin
./install.sh --remove
# Show help
./install.sh --help- Download the latest release from https://qgis.gishub.org.
- Extract the zip file
- Copy the
qgis_notebookfolder to your QGIS plugins directory:- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/
- Linux:
- Restart QGIS
- Enable the plugin in Plugins β Manage and Install Plugins...
- Click the π Open button in the toolbar
- Navigate to and select a
.ipynbfile - The notebook will be rendered in the panel
- Click the βΆ Run button on any code cell to execute it
- Use βΆβΆ Run All to execute all cells in order
- View output directly below each cell
- Click the π New button
- Start adding code and markdown cells
- Save with πΎ Save
Click the CODE or MARKDOWN badge in the cell header to switch between code and markdown cell types.
Right-click on any cell to access:
- Add Code/Markdown Cell Above/Below
- Clear Output (code cells only)
- Convert to Markdown/Code
- Split Cell at Cursor β splits the cell into two at the current cursor position
- Delete Cell
The plugin supports JupyterLab-style keyboard shortcuts for efficient notebook editing.
| Shortcut | Action |
|---|---|
Ctrl+Enter |
Execute current cell |
Shift+Enter |
Execute cell and move to next |
Alt+Enter |
Execute cell and insert new cell below |
Ctrl+Space |
Trigger autocomplete |
To enter command mode, click outside the text editor area of a cell (e.g., on the cell border or header).
| Shortcut | Action |
|---|---|
A |
Insert code cell above |
B |
Insert code cell below |
X |
Cut selected cell |
D, D |
Delete selected cell (press D twice) |
Y |
Change cell type to Code |
M |
Change cell type to Markdown |
| Shortcut | Action |
|---|---|
Ctrl+Shift+Up |
Move cell up |
Ctrl+Shift+Down |
Move cell down |
Ctrl+Shift+- |
Split cell at cursor position |
Access settings via the Settings button in the toolbar:
- Auto-save notebooks
- Show line numbers
- Word wrap in cells
- Execution timeout
- Clear outputs before run
- Stop on error
- Pre-import modules (QGIS, os, sys, numpy, pandas)
- Color scheme
- Code font family
- Font size
- Line height
- Cell spacing
The plugin automatically imports QGIS modules, making it easy to work with your project:
# Access the current project
from qgis.core import QgsProject
project = QgsProject.instance()
# List all layers
for layer in project.mapLayers().values():
print(layer.name())
# Access the map canvas
from qgis.utils import iface
canvas = iface.mapCanvas()- QGIS 3.28 or later
- Python 3.10 or later (included with QGIS)
The plugin includes a built-in update checker that can:
- Check for new versions from GitHub
- Display changelog information
- Download and install updates automatically
Access it via Notebook β Check for Updates...
The About dialog displays:
- Current plugin version
- Author information
- Feature list
- Links to GitHub repository and issue tracker
Access it via Notebook β About QGIS Notebook
# Create a zip file for distribution
python package_plugin.py
# Create without version in filename
python package_plugin.py --no-version
# Custom output path
python package_plugin.py --output /path/to/output.zip# Create a zip file for distribution
./package_plugin.sh
# Create without version in filename
./package_plugin.sh --no-version
# Show help
./package_plugin.sh --helpThe packaged zip file can be uploaded to the QGIS Plugin Repository.
qgis-notebook-plugin/
βββ install.py # Cross-platform installation script
βββ install.sh # Shell installation script (Linux/macOS)
βββ package_plugin.py # Cross-platform packaging script
βββ package_plugin.sh # Shell packaging script (Linux/macOS)
βββ README.md # This file
βββ LICENSE # MIT License
βββ qgis_notebook/ # Main plugin directory
βββ __init__.py # Plugin entry point
βββ qgis_notebook.py # Main plugin class
βββ metadata.txt # Plugin metadata
βββ LICENSE # Plugin license
βββ dialogs/
β βββ __init__.py
β βββ notebook_dock.py # Main notebook dock widget
β βββ settings_dock.py # Settings panel
β βββ update_checker.py # Update checker dialog
βββ icons/
βββ icon.svg # Main plugin icon
βββ settings.svg # Settings icon
βββ about.svg # About icon
To package the plugin for distribution, use the provided scripts:
cd qgis-notebook-plugin
# Using Python (cross-platform)
python package_plugin.py
# Using shell script (Linux/macOS)
./package_plugin.sh
# Or manually
zip -r qgis_notebook.zip qgis_notebook/The output will be a file like qgis_notebook-0.1.0.zip ready for distribution.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Fix line spacing issue on Linux
- Add support for light theme
- Add support for clearing output of a code cell
- Add support for inserting code snippets into a notebook
- Basic notebook rendering and execution
- Dockable panel interface
- Python syntax highlighting
- Markdown cell rendering
- Settings panel for configuration
- Update checker functionality
- QGIS module integration



