gas-client 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gas_client-0.1.0/LICENSE +21 -0
- gas_client-0.1.0/MANIFEST.in +2 -0
- gas_client-0.1.0/PKG-INFO +158 -0
- gas_client-0.1.0/README.md +131 -0
- gas_client-0.1.0/gas_client/__init__.py +15 -0
- gas_client-0.1.0/gas_client/client.py +889 -0
- gas_client-0.1.0/gas_client.egg-info/PKG-INFO +158 -0
- gas_client-0.1.0/gas_client.egg-info/SOURCES.txt +11 -0
- gas_client-0.1.0/gas_client.egg-info/dependency_links.txt +1 -0
- gas_client-0.1.0/gas_client.egg-info/requires.txt +1 -0
- gas_client-0.1.0/gas_client.egg-info/top_level.txt +1 -0
- gas_client-0.1.0/pyproject.toml +46 -0
- gas_client-0.1.0/setup.cfg +4 -0
gas_client-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Geoinformation and Big Data Research Lab (GIBD)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gas-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for Geospatial Agentic Services (GAS).
|
|
5
|
+
Author: Geoinformation and Big Data Research Lab (GIBD)
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://www.geospatial-agentic-services.online
|
|
8
|
+
Project-URL: Documentation, https://www.geospatial-agentic-services.online
|
|
9
|
+
Keywords: geospatial,agentic services,GAS,SDK,OGC,geospatial AI
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: requests<3.0,>=2.31
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# GAS Client
|
|
29
|
+
|
|
30
|
+
Python SDK for Geospatial Agentic Services (GAS).
|
|
31
|
+
|
|
32
|
+
This package contains only the lightweight client layer. It does not install the
|
|
33
|
+
GAS server, Flask, GeoPandas, Rasterio, PySAL, or other geospatial runtime
|
|
34
|
+
dependencies.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
Install from the package folder during development:
|
|
39
|
+
|
|
40
|
+
```powershell
|
|
41
|
+
cd D:\GAS\packages\gas-client
|
|
42
|
+
python -m pip install -e .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
After publication:
|
|
46
|
+
|
|
47
|
+
```powershell
|
|
48
|
+
python -m pip install gas-client
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from gas_client import GasClient
|
|
55
|
+
|
|
56
|
+
client = GasClient(
|
|
57
|
+
"https://your-gas-server.com",
|
|
58
|
+
openai_api_key="YOUR_OPENAI_API_KEY",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
print(client.list_agents())
|
|
62
|
+
|
|
63
|
+
agent = client.agent("geospatial_data_retrieval_agent")
|
|
64
|
+
|
|
65
|
+
result = agent.execute_task(
|
|
66
|
+
"Download Pennsylvania county boundaries from Census Bureau.",
|
|
67
|
+
mode="sync",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
client.print_task_summary(result)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Streaming Tasks
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
for event in agent.execute_task(
|
|
77
|
+
"Download Pennsylvania county boundaries from Census Bureau.",
|
|
78
|
+
mode="stream",
|
|
79
|
+
):
|
|
80
|
+
client.print_stream_event(event)
|
|
81
|
+
if event.get("event") == "task_result":
|
|
82
|
+
result = event.get("payload")
|
|
83
|
+
|
|
84
|
+
client.print_task_summary(result)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Canonical GAS Request Body
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
request_body = client.build_execute_task_request(
|
|
91
|
+
"Create an interactive web map.",
|
|
92
|
+
mode="stream",
|
|
93
|
+
input_datasets=[
|
|
94
|
+
"https://example.com/counties.geojson",
|
|
95
|
+
],
|
|
96
|
+
artifact_delivery="URL",
|
|
97
|
+
credentials={
|
|
98
|
+
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
for event in client.agent("interactive_mapping_agent").execute_task_request(request_body):
|
|
103
|
+
client.print_stream_event(event)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Public API
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from gas_client import (
|
|
110
|
+
GASClient,
|
|
111
|
+
GasAgentClient,
|
|
112
|
+
GasClient,
|
|
113
|
+
GasClientError,
|
|
114
|
+
GasTaskTimeoutError,
|
|
115
|
+
)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Important methods:
|
|
119
|
+
|
|
120
|
+
- `get_capabilities()`
|
|
121
|
+
- `list_agents()`
|
|
122
|
+
- `describe_agent(agent_id)`
|
|
123
|
+
- `agent(agent_id)`
|
|
124
|
+
- `execute_task(agent_id, instructions, mode="sync")`
|
|
125
|
+
- `execute_task_request(agent_id, request_body)`
|
|
126
|
+
- `get_task_status(agent_id, task_id)`
|
|
127
|
+
- `get_task_result(agent_id, task_id)`
|
|
128
|
+
- `wait_for_task(agent_id, task_id)`
|
|
129
|
+
- `cancel_task(agent_id, task_id)`
|
|
130
|
+
- `encode_dataset_file(path)`
|
|
131
|
+
- `print_stream_event(event)`
|
|
132
|
+
- `print_task_summary(result)`
|
|
133
|
+
|
|
134
|
+
## Publishing Checklist
|
|
135
|
+
|
|
136
|
+
Before publishing publicly:
|
|
137
|
+
|
|
138
|
+
- Confirm the final package name on PyPI.
|
|
139
|
+
- Update `version` in `pyproject.toml`.
|
|
140
|
+
- Sync the package copy from the repository root if `D:\GAS\gas_client` changed.
|
|
141
|
+
- Run client tests from the repository root.
|
|
142
|
+
- Build and inspect the package.
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
cd D:\GAS
|
|
146
|
+
.\packages\gas-client\sync_from_repo.ps1
|
|
147
|
+
.\.venv\Scripts\python.exe -m pytest tests\test_gas_client.py
|
|
148
|
+
|
|
149
|
+
cd D:\GAS\packages\gas-client
|
|
150
|
+
python -m build
|
|
151
|
+
python -m twine check dist/*
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Upload only when ready:
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
python -m twine upload dist/*
|
|
158
|
+
```
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# GAS Client
|
|
2
|
+
|
|
3
|
+
Python SDK for Geospatial Agentic Services (GAS).
|
|
4
|
+
|
|
5
|
+
This package contains only the lightweight client layer. It does not install the
|
|
6
|
+
GAS server, Flask, GeoPandas, Rasterio, PySAL, or other geospatial runtime
|
|
7
|
+
dependencies.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Install from the package folder during development:
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
cd D:\GAS\packages\gas-client
|
|
15
|
+
python -m pip install -e .
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
After publication:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
python -m pip install gas-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from gas_client import GasClient
|
|
28
|
+
|
|
29
|
+
client = GasClient(
|
|
30
|
+
"https://your-gas-server.com",
|
|
31
|
+
openai_api_key="YOUR_OPENAI_API_KEY",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
print(client.list_agents())
|
|
35
|
+
|
|
36
|
+
agent = client.agent("geospatial_data_retrieval_agent")
|
|
37
|
+
|
|
38
|
+
result = agent.execute_task(
|
|
39
|
+
"Download Pennsylvania county boundaries from Census Bureau.",
|
|
40
|
+
mode="sync",
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
client.print_task_summary(result)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Streaming Tasks
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
for event in agent.execute_task(
|
|
50
|
+
"Download Pennsylvania county boundaries from Census Bureau.",
|
|
51
|
+
mode="stream",
|
|
52
|
+
):
|
|
53
|
+
client.print_stream_event(event)
|
|
54
|
+
if event.get("event") == "task_result":
|
|
55
|
+
result = event.get("payload")
|
|
56
|
+
|
|
57
|
+
client.print_task_summary(result)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Canonical GAS Request Body
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
request_body = client.build_execute_task_request(
|
|
64
|
+
"Create an interactive web map.",
|
|
65
|
+
mode="stream",
|
|
66
|
+
input_datasets=[
|
|
67
|
+
"https://example.com/counties.geojson",
|
|
68
|
+
],
|
|
69
|
+
artifact_delivery="URL",
|
|
70
|
+
credentials={
|
|
71
|
+
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
|
|
72
|
+
},
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
for event in client.agent("interactive_mapping_agent").execute_task_request(request_body):
|
|
76
|
+
client.print_stream_event(event)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Public API
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from gas_client import (
|
|
83
|
+
GASClient,
|
|
84
|
+
GasAgentClient,
|
|
85
|
+
GasClient,
|
|
86
|
+
GasClientError,
|
|
87
|
+
GasTaskTimeoutError,
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Important methods:
|
|
92
|
+
|
|
93
|
+
- `get_capabilities()`
|
|
94
|
+
- `list_agents()`
|
|
95
|
+
- `describe_agent(agent_id)`
|
|
96
|
+
- `agent(agent_id)`
|
|
97
|
+
- `execute_task(agent_id, instructions, mode="sync")`
|
|
98
|
+
- `execute_task_request(agent_id, request_body)`
|
|
99
|
+
- `get_task_status(agent_id, task_id)`
|
|
100
|
+
- `get_task_result(agent_id, task_id)`
|
|
101
|
+
- `wait_for_task(agent_id, task_id)`
|
|
102
|
+
- `cancel_task(agent_id, task_id)`
|
|
103
|
+
- `encode_dataset_file(path)`
|
|
104
|
+
- `print_stream_event(event)`
|
|
105
|
+
- `print_task_summary(result)`
|
|
106
|
+
|
|
107
|
+
## Publishing Checklist
|
|
108
|
+
|
|
109
|
+
Before publishing publicly:
|
|
110
|
+
|
|
111
|
+
- Confirm the final package name on PyPI.
|
|
112
|
+
- Update `version` in `pyproject.toml`.
|
|
113
|
+
- Sync the package copy from the repository root if `D:\GAS\gas_client` changed.
|
|
114
|
+
- Run client tests from the repository root.
|
|
115
|
+
- Build and inspect the package.
|
|
116
|
+
|
|
117
|
+
```powershell
|
|
118
|
+
cd D:\GAS
|
|
119
|
+
.\packages\gas-client\sync_from_repo.ps1
|
|
120
|
+
.\.venv\Scripts\python.exe -m pytest tests\test_gas_client.py
|
|
121
|
+
|
|
122
|
+
cd D:\GAS\packages\gas-client
|
|
123
|
+
python -m build
|
|
124
|
+
python -m twine check dist/*
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Upload only when ready:
|
|
128
|
+
|
|
129
|
+
```powershell
|
|
130
|
+
python -m twine upload dist/*
|
|
131
|
+
```
|