Metadata-Version: 2.5
Name: qgis-sdk
Version: 0.3.0
Summary: Python SDK foundations for QGIS plugin development.
Author: QGIS SDK contributors
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: typer==0.27.3
Provides-Extra: controlled-deployment
Requires-Dist: pydantic==2.14.1; extra == 'controlled-deployment'
Provides-Extra: dev
Requires-Dist: hypothesis==6.169.4; extra == 'dev'
Requires-Dist: jsonschema==4.26.0; extra == 'dev'
Requires-Dist: mashumaro==3.23; extra == 'dev'
Requires-Dist: pydantic==2.14.1; extra == 'dev'
Requires-Dist: pytest-bdd==9.0.0; extra == 'dev'
Requires-Dist: pytest-cov==7.1.0; extra == 'dev'
Requires-Dist: pytest==9.1.1; extra == 'dev'
Requires-Dist: pyyaml==6.0.3; extra == 'dev'
Requires-Dist: rich==15.0.0; extra == 'dev'
Requires-Dist: typer==0.27.3; extra == 'dev'
Description-Content-Type: text/markdown

# qgis-sdk

**Python SDK foundations for QGIS plugins.**

Declare a plugin on plain classes and let the SDK derive the rest: the JSON
description a web view reads, the native dialogs, the Processing algorithms, the
bridge allowlist and the generated TypeScript client. The pure layers import
without QGIS or Qt, so a plugin is testable from source.

> Experimental `0.2.0`. Each `0.Y.0` carries migration notes; nothing is
> promised stable before `1.0.0`.

## Installation

```sh
pip install qgis-sdk
pip install "qgis-sdk[controlled-deployment]"   # optional Pydantic adapter
pixi add --channel https://prefix.dev/archont561/archont561 qgis-sdk
```

## Example

```python
from dataclasses import dataclass

from qgis_sdk import action, describe_plugin, plugin


@dataclass
class RunRequest:
    count: int
    label: str | None = None


@plugin(id="example.tools", title="Example tools")
class Tools:
    def __init__(self, ctx):
        self.ctx = ctx

    @action(id="run", title="Run")
    def run(self, request: RunRequest) -> int:
        return request.count


print(describe_plugin(Tools).to_json())
```

`qgis-sdk scaffold <directory>` writes a loadable plugin project built on the
same API.

## Documentation

- [Python package guide](https://github.com/Archont561/qgis-sdk/blob/main/backlog/docs/guides/doc-12%20-%20qgis-sdk-Python-package-guide.md) -
  declarations, runtime, adapters, forms, algorithms, the bridge host side,
  the scaffold, release and migration notes.
- [TypeScript bridge](https://www.npmjs.com/package/@archont561/qgis-sdk-bridge) -
  the companion package for a `QWebEngineView` interface.
- [Workspace, harnesses and qualification evidence](https://github.com/Archont561/qgis-sdk/blob/main/backlog/docs/guides/doc-14%20-%20Workspace-development-qualification-harnesses-and-evidence.md).

## License

MIT
