Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add znlgis/opengis-skills --skill pyqgisgit clone --depth 1 https://github.com/znlgis/opengis-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/znlgis/opengis-skills/pyqgis)<a href="https://agentmods.dev/skills/znlgis/opengis-skills/pyqgis"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/pyqgis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/pyqgis"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/pyqgis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.04069 |
| Opus 5 | $0.00022 | $0.02034 |
| Sonnet 5 | $0.00009 | $0.00814 |
| Haiku 4.5 | $0.00004 | $0.00407 |
Grade A, and why
pyqgis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 411 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目地址: https://github.com/qgis/QGIS
开发者手册: https://docs.qgis.org/4.2/en/docs/pyqgis_developer_cookbook/
Python API 参考: https://qgis.org/pyqgis/4.2/
许可证: GPL-2.0+
概述
PyQGIS 是 QGIS 桌面 GIS 软件的 Python 绑定层,对应 QGIS 源码中 python/ 目录下的绑定代码。它将 QGIS 核心 C++ 类库完整暴露给 Python,使得开发者可以:
- 在 QGIS Python 控制台中交互式操作
- 编写 独立 Python 脚本(无需启动 QGIS 桌面)
- 开发 QGIS 插件扩展桌面功能
- 调用 Processing 框架执行 100+ 种空间分析算法
- 进行 地图渲染与导出(PNG / PDF / SVG)
PyQGIS 主要包含以下模块:
| 模块 | 说明 |
|---|---|
qgis.core |
核心类——图层、要素、几何、坐标系、项目、Processing 等 |
qgis.gui |
GUI 组件——地图画布、地图工具、符号选择器等 |
qgis.analysis |
空间分析——插值、网络分析、栅格计算等 |
qgis.processing |
Processing 算法调用入口(processing.run()) |
qgis.server |
QGIS Server Python 插件接口 |
qgis.3d |
3D 地图视图相关类 |
qgis.PyQt |
PyQt5/PyQt6 兼容层 |
环境准备
前置条件
- 安装 QGIS 3.16+(查看 QGIS LTR/最新版)
- Python 3.9+(QGIS 自带 Python 环境)
在 QGIS Python 控制台中使用
打开 QGIS 桌面 → 菜单「Plugins → Python Console」,即可直接使用 PyQGIS:
# QGIS 控制台中无需初始化,直接使用
layer = iface.activeLayer()
print(layer.name(), layer.featureCount())
独立脚本(Standalone Script)
在 QGIS 外部运行 Python 脚本时,需要先初始化 QGIS 应用:
import sys
from qgis.core import QgsApplication
# 初始化 QGIS(False 表示不使用 GUI)
qgs = QgsApplication([], False)
qgs.setPrefixPath("/usr", True) # Linux; Windows 示例:"C:/OSGeo4W/apps/qgis"
qgs.initQgis()
# ===== 在此处编写 PyQGIS 代码 =====
# 退出
qgs.exitQgis()
独立脚本中使用 Processing
import sys
from qgis.core import QgsApplication
import processing
from processing.core.Processing import Processing
qgs = QgsApplication([], False)
qgs.setPrefixPath("/usr", True)
qgs.initQgis()
# 初始化 Processing 框架
Processing.initialize()
# 现在可以使用 processing.run()
result = processing.run("native:buffer", {
'INPUT': '/data/points.shp',
'DISTANCE': 100,
'OUTPUT': '/data/buffered.shp'
})
qgs.exitQgis()
Headless 服务器环境
export QT_QPA_PLATFORM=offscreen
python3 my_pyqgis_script.py
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed ee1b4010fb51
- 8d ago First seen · 411 lines · 44 tokens per session scan A 86d9da392b02
pyqgis is a skill published in the GitHub repository znlgis/opengis-skills (61 stars, last pushed today), licensed MIT. It adds 44 tokens to every session and 4,069 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
commands-create-slash-command
Create or edit reusable Agent Zero /commands with YAML and text/Python templates.
plugin-system
Generic plugin system for Python applications. Auto-discovery, validation, fault tolerance. Zero dependencies (Python stdlib only).
domain-driven-design
DDD tactical patterns for complex business modeling including entities, value objects, aggregates, domain services, repositories, specifications, and bounded contexts. Python dataclass implementations with TypeScript alternatives. Use when building rich domain models, enforcing invariants, or separating domain logic…
qgis-syntax-pyqgis-api
Use when writing PyQGIS scripts, accessing features, editing layers, or performing geometry operations. Prevents edit session violations, threading crashes, and inefficient feature iteration. Covers 4 scripting contexts, feature CRUD, geometry operations, spatial indexing, background tasks, and basic symbology.…
pn-python-scaffolding
Scaffolds new Python API projects (FastAPI, Flask, Django) or routes. Use when adding a new route/module; covers project layout, env/secrets, validation, error handling, and idiomatic Python patterns.
pennylane
Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…