Metadata-Version: 2.4
Name: gas-client
Version: 0.1.0
Summary: Python SDK for Geospatial Agentic Services (GAS).
Author: Geoinformation and Big Data Research Lab (GIBD)
License-Expression: MIT
Project-URL: Homepage, https://www.geospatial-agentic-services.online
Project-URL: Documentation, https://www.geospatial-agentic-services.online
Keywords: geospatial,agentic services,GAS,SDK,OGC,geospatial AI
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests<3.0,>=2.31
Dynamic: license-file

# GAS Client

Python SDK for Geospatial Agentic Services (GAS).

This package contains only the lightweight client layer. It does not install the
GAS server, Flask, GeoPandas, Rasterio, PySAL, or other geospatial runtime
dependencies.

## Install

Install from the package folder during development:

```powershell
cd D:\GAS\packages\gas-client
python -m pip install -e .
```

After publication:

```powershell
python -m pip install gas-client
```

## Quick Start

```python
from gas_client import GasClient

client = GasClient(
    "https://your-gas-server.com",
    openai_api_key="YOUR_OPENAI_API_KEY",
)

print(client.list_agents())

agent = client.agent("geospatial_data_retrieval_agent")

result = agent.execute_task(
    "Download Pennsylvania county boundaries from Census Bureau.",
    mode="sync",
)

client.print_task_summary(result)
```

## Streaming Tasks

```python
for event in agent.execute_task(
    "Download Pennsylvania county boundaries from Census Bureau.",
    mode="stream",
):
    client.print_stream_event(event)
    if event.get("event") == "task_result":
        result = event.get("payload")

client.print_task_summary(result)
```

## Canonical GAS Request Body

```python
request_body = client.build_execute_task_request(
    "Create an interactive web map.",
    mode="stream",
    input_datasets=[
        "https://example.com/counties.geojson",
    ],
    artifact_delivery="URL",
    credentials={
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
    },
)

for event in client.agent("interactive_mapping_agent").execute_task_request(request_body):
    client.print_stream_event(event)
```

## Public API

```python
from gas_client import (
    GASClient,
    GasAgentClient,
    GasClient,
    GasClientError,
    GasTaskTimeoutError,
)
```

Important methods:

- `get_capabilities()`
- `list_agents()`
- `describe_agent(agent_id)`
- `agent(agent_id)`
- `execute_task(agent_id, instructions, mode="sync")`
- `execute_task_request(agent_id, request_body)`
- `get_task_status(agent_id, task_id)`
- `get_task_result(agent_id, task_id)`
- `wait_for_task(agent_id, task_id)`
- `cancel_task(agent_id, task_id)`
- `encode_dataset_file(path)`
- `print_stream_event(event)`
- `print_task_summary(result)`

## Publishing Checklist

Before publishing publicly:

- Confirm the final package name on PyPI.
- Update `version` in `pyproject.toml`.
- Sync the package copy from the repository root if `D:\GAS\gas_client` changed.
- Run client tests from the repository root.
- Build and inspect the package.

```powershell
cd D:\GAS
.\packages\gas-client\sync_from_repo.ps1
.\.venv\Scripts\python.exe -m pytest tests\test_gas_client.py

cd D:\GAS\packages\gas-client
python -m build
python -m twine check dist/*
```

Upload only when ready:

```powershell
python -m twine upload dist/*
```
