{"id":42881953,"url":"https://github.com/opengeos/qgis-plugin-template","last_synced_at":"2026-02-27T23:54:44.329Z","repository":{"id":330309769,"uuid":"1122071172","full_name":"opengeos/qgis-plugin-template","owner":"opengeos","description":"A QGIS plugin template","archived":false,"fork":false,"pushed_at":"2026-01-20T01:53:27.000Z","size":32,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T02:25:44.062Z","etag":null,"topics":["data-science","geosptial","python","qgis","qgis-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opengeos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T04:00:57.000Z","updated_at":"2026-01-20T01:53:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/opengeos/qgis-plugin-template","commit_stats":null,"previous_names":["opengeos/qgis-plugin-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opengeos/qgis-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeos%2Fqgis-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeos%2Fqgis-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeos%2Fqgis-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeos%2Fqgis-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opengeos","download_url":"https://codeload.github.com/opengeos/qgis-plugin-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opengeos%2Fqgis-plugin-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","geosptial","python","qgis","qgis-plugin"],"created_at":"2026-01-30T14:41:42.824Z","updated_at":"2026-01-30T14:41:42.976Z","avatar_url":"https://github.com/opengeos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QGIS Plugin Template\n\nA comprehensive template for creating QGIS plugins with dockable panels, update checker, and all the essential features needed for a professional plugin.\n\n## Features\n\n- **Dockable Panels**: Sample panels that can be docked anywhere in the QGIS interface\n- **Plugin Update Checker**: Check for updates from GitHub and install them automatically\n- **About Dialog**: Display version information and links\n- **Settings Panel**: Configurable plugin options with persistent storage\n- **Menu \u0026 Toolbar Integration**: Full integration with QGIS menu system and custom toolbar\n- **Clean Code Structure**: Well-organized, documented, and following QGIS plugin best practices\n- **Packaging Scripts**: Ready-to-use scripts for creating zip files for the official QGIS plugin repository\n\n## Project Structure\n\n```\nqgis-plugin-template/\n├── plugin_template/\n│   ├── __init__.py              # Plugin entry point\n│   ├── plugin_template.py       # Main plugin class\n│   ├── metadata.txt             # Plugin metadata for QGIS\n│   ├── LICENSE                  # Plugin license\n│   ├── dialogs/\n│   │   ├── __init__.py\n│   │   ├── sample_dock.py       # Sample dockable panel\n│   │   ├── settings_dock.py     # Settings panel\n│   │   └── update_checker.py    # Update checker dialog\n│   └── icons/\n│       ├── icon.svg             # Main plugin icon\n│       ├── settings.svg         # Settings icon\n│       └── about.svg            # About icon\n├── package_plugin.py                # Python packaging script\n├── package_plugin.sh                # Bash packaging script\n├── install.py                       # Python installation script\n├── install.sh                       # Bash installation script\n├── README.md                        # This file\n└── LICENSE                          # Repository license\n```\n\n## Requirements\n\n- QGIS 3.28 or later\n- Python 3.10+\n\n## Quick Start\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/opengeos/qgis-plugin-template.git\ncd qgis-plugin-template\n```\n\n### 2. Customize the Template\n\n1. **Rename the plugin**:\n   - Rename `plugin_template/` to your plugin name\n   - Update class names in Python files (e.g., `PluginTemplate` → `YourPluginName`)\n   - Update `metadata.txt` with your plugin information\n\n2. **Update metadata.txt**:\n   ```ini\n   [general]\n   name=Your Plugin Name\n   version=0.1.0\n   author=Your Name\n   email=your.email@example.com\n   description=Your plugin description\n   repository=https://github.com/opengeos/your-plugin\n   tracker=https://github.com/opengeos/your-plugin/issues\n   ```\n\n3. **Update GitHub URLs** in `plugin_template/dialogs/update_checker.py`:\n   ```python\n   GITHUB_REPO = \"opengeos/your-plugin\"\n   GITHUB_BRANCH = \"main\"\n   PLUGIN_PATH = \"your_plugin\"\n   ```\n\n### 3. Install for Development\n\nUsing Python:\n```bash\npython install.py\n```\n\nUsing Bash:\n```bash\n./install.sh\n```\n\n### 4. Enable in QGIS\n\n1. Restart QGIS\n2. Go to `Plugins` → `Manage and Install Plugins...`\n3. Find and enable your plugin\n\n## Development\n\n### Adding a New Dockable Panel\n\n1. Create a new file in `dialogs/` (e.g., `my_dock.py`):\n\n```python\nfrom qgis.PyQt.QtCore import Qt\nfrom qgis.PyQt.QtWidgets import QDockWidget, QWidget, QVBoxLayout, QLabel\n\nclass MyDockWidget(QDockWidget):\n    def __init__(self, iface, parent=None):\n        super().__init__(\"My Panel\", parent)\n        self.iface = iface\n        self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)\n\n        # Create widget content\n        widget = QWidget()\n        layout = QVBoxLayout(widget)\n        layout.addWidget(QLabel(\"Hello from my panel!\"))\n        self.setWidget(widget)\n```\n\n2. Add the import to `dialogs/__init__.py`\n\n3. Add toggle method in `plugin_template.py`:\n```python\ndef toggle_my_dock(self):\n    if self._my_dock is None:\n        from .dialogs.my_dock import MyDockWidget\n        self._my_dock = MyDockWidget(self.iface, self.iface.mainWindow())\n        self.iface.addDockWidget(Qt.RightDockWidgetArea, self._my_dock)\n\n    if self._my_dock.isVisible():\n        self._my_dock.hide()\n    else:\n        self._my_dock.show()\n```\n\n### Adding a Menu Action\n\n```python\nself.add_action(\n    \":/images/themes/default/mActionOptions.svg\",  # Icon path\n    \"My Action\",                                     # Menu text\n    self.my_action_callback,                        # Callback function\n    status_tip=\"Description of action\",\n    add_to_toolbar=True,                            # Add to toolbar\n    add_to_menu=True,                               # Add to menu\n    parent=self.iface.mainWindow(),\n)\n```\n\n### Storing Settings\n\nUse `QSettings` for persistent configuration:\n\n```python\nfrom qgis.PyQt.QtCore import QSettings\n\nsettings = QSettings()\n\n# Save setting\nsettings.setValue(\"PluginTemplate/my_setting\", value)\n\n# Load setting\nvalue = settings.value(\"PluginTemplate/my_setting\", default_value, type=str)\n```\n\n## Packaging for QGIS Plugin Repository\n\n### Using Python Script\n\n```bash\n# Default packaging\npython package_plugin.py\n\n# Custom plugin name\npython package_plugin.py --name my_plugin\n\n# Custom output path\npython package_plugin.py --output /path/to/my_plugin.zip\n\n# Without version in filename\npython package_plugin.py --no-version\n```\n\n### Using Bash Script\n\n```bash\n# Make executable (first time only)\nchmod +x package_plugin.sh\n\n# Default packaging\n./package_plugin.sh\n\n# Custom plugin name\n./package_plugin.sh --name my_plugin\n\n# Custom output directory\n./package_plugin.sh --output /path/to/output\n```\n\n### Uploading to QGIS Plugin Repository\n\n1. Create an account at [plugins.qgis.org](https://plugins.qgis.org/)\n2. Go to \"My plugins\" and click \"Add a new plugin\"\n3. Upload the generated zip file\n4. Fill in the required information\n5. Submit for review\n\n## Installation Options\n\n### Option A: QGIS Plugin Manager (Recommended)\n\n1. Open QGIS\n2. Go to **Plugins** → **Manage and Install Plugins...**\n3. Go to the **Settings** tab\n4. Click **Add...** under \"Plugin Repositories\"\n5. Give a name for the repository, e.g., \"OpenGeos\"\n6. Enter the URL of the repository: https://qgis.gishub.org/plugins.xml\n7. Click **OK**\n8. Go to the **All** tab\n9. Search for your plugin name\n10. Select your plugin from the list and click **Install Plugin**\n\n### Option B: Install Script\n\n```bash\n# Install\npython install.py\n\n# Or with bash\n./install.sh\n\n# Remove\npython install.py --remove\n\n# Install with custom name\npython install.py --name my_plugin\n```\n\n### Option C: Manual Installation\n\nCopy the plugin folder to your QGIS plugins directory:\n\n- **Linux**: `~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/`\n- **macOS**: `~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/`\n- **Windows**: `%APPDATA%\\QGIS\\QGIS3\\profiles\\default\\python\\plugins\\`\n\n## Plugin Update Checker\n\nThe template includes a built-in update checker that:\n\n1. Fetches the latest version from your GitHub repository\n2. Compares with the currently installed version\n3. Downloads and installs updates automatically\n4. Shows changelog information\n\nTo use it:\n1. Go to `Plugin Template` → `Check for Updates...`\n2. Click \"Check for Updates\"\n3. If an update is available, click \"Download and Install Update\"\n4. Restart QGIS to apply changes\n\n## Customization Checklist\n\nWhen using this template for your own plugin:\n\n- [ ] Rename `plugin_template` folder to your plugin name\n- [ ] Update `metadata.txt` with your information\n- [ ] Update class names in all Python files\n- [ ] Update menu names and toolbar names\n- [ ] Update GitHub URLs in `update_checker.py`\n- [ ] Replace icons with your own\n- [ ] Update this README\n- [ ] Update LICENSE if needed\n- [ ] Add your plugin functionality\n\n## Best Practices\n\n1. **Lazy Loading**: Load heavy resources only when needed\n2. **Error Handling**: Always wrap dock creation in try/except\n3. **Cleanup**: Properly unload all resources in the `unload()` method\n4. **Threading**: Use QThread for long-running operations\n5. **Settings**: Use QSettings for persistent configuration\n6. **Icons**: Use SVG icons for resolution independence\n7. **Documentation**: Keep docstrings updated\n\n## License\n\nThis template is released under the MIT License. See [LICENSE](LICENSE) for details.\n\nWhen creating your own plugin, you may choose any license that suits your needs.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Links\n\n- [QGIS Plugin Development Documentation](https://docs.qgis.org/latest/en/docs/pyqgis_developer_cookbook/)\n- [PyQGIS Developer Cookbook](https://docs.qgis.org/latest/en/docs/pyqgis_developer_cookbook/)\n- [QGIS Plugin Repository](https://plugins.qgis.org/)\n- [Qt for Python Documentation](https://doc.qt.io/qtforpython/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengeos%2Fqgis-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopengeos%2Fqgis-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengeos%2Fqgis-plugin-template/lists"}