Metadata-Version: 2.4
Name: qgis-bridge
Version: 0.1.0
Summary: Push spatial data from Python directly into a live QGIS session
Project-URL: Homepage, https://github.com/R-Repo/qgis-bridge
Project-URL: Repository, https://github.com/R-Repo/qgis-bridge
Project-URL: Issues, https://github.com/R-Repo/qgis-bridge/issues
Author: Raza Rizvi
License: MIT License
        
        Copyright (c) 2026 Raza Rizvi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: GIS
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# qgis-bridge

Push spatial data from Python directly into a live QGIS session — no file exports, no manual imports, no QGIS-specific knowledge required.

## Overview

`qgis-bridge` eliminates the friction of moving data between Python analysis environments and QGIS for visualization. Run your spatial analysis in a Jupyter notebook or Python script, then send results to QGIS with a single function call.

## Usage

**Standalone function:**
```python
from qgis_bridge import to_qgis

to_qgis(gdf, layer_name="Risk Zones", color_by="risk_score")
```

**GeoDataFrame accessor:**
```python
import qgis_bridge  # registers the .qgis accessor on GeoDataFrame

gdf.qgis.send(layer_name="Risk Zones", color_by="risk_score")
```

**Cloud raster URIs (streamed directly, no local download):**
```python
to_qgis("gs://my-bucket/elevation.tif", layer_name="Elevation")
to_qgis("s3://my-bucket/imagery.tif", layer_name="Imagery")
to_qgis("az://my-container/dem.tif", layer_name="DEM")
```

## Supported Data Types

- **Vector**: GeoDataFrame with a CRS set
- **Raster**: Cloud GeoTIFFs via GCS (`gs://`), S3 (`s3://`), or Azure Blob (`az://`)

## Design

- Zero QGIS installation required in the Python environment
- Communicates with an already-running QGIS instance
- No authentication surface — credential resolution handled by QGIS/GDAL
- Works in Jupyter, JupyterLab, VS Code, and plain Python scripts

## Installation

```bash
pip install qgis-bridge
```

The QGIS plugin must also be installed separately inside QGIS (Plugins > Install from Zip), using the `qgis_plugin/` directory from this repository.

## Contributing

This project uses [uv](https://docs.astral.sh/uv/) for development.

```bash
# Install uv (if not already installed)
brew install uv          # macOS
pip install uv           # any platform

# Clone and set up
git clone https://github.com/R-Repo/qgis-bridge
cd qgis-bridge
uv sync --group dev      # creates .venv and installs all dependencies

# Run tests (no QGIS required)
uv run pytest tests/
```

## Status

Early development. API subject to change.

## License

MIT
