Python Analyst Demo Suite

August 9, 2026 ยท View on GitHub

This directory contains runnable examples for Python-first Honua workflows. The demos are script-first so notebooks and services can reuse shared modules instead of carrying duplicate business logic.

Cloud Environment Contract

All demos that call Honua use the same environment variables:

  • HONUA_BASE_URL: Honua deployment URL. Defaults to http://localhost:8080 for local demos.
  • HONUA_API_KEY: optional API key for deployments that require API-key auth.
  • HONUA_SERVICE_ID: FeatureServer service id. Defaults to test_service.
  • HONUA_LAYER_ID: FeatureServer layer id. Defaults to 0.
  • HONUA_COLLECTION_ID: OGC API Features collection id for protocol demos. Defaults to the service id.
  • HONUA_STAC_COLLECTION_ID: optional STAC collection id for imagery demos.

The checked-in examples target the seeded test_service layer used by local Honua server development. Cloud runs should point the variables at an equivalent writable or readable fixture.

Demos

DemoTarget userExtrasEntry pointArtifacts
GeoPandas ETLAnalyst loading cleaned point data into Honuahonua-sdk[geopandas], matplotlibpython examples/geospatial_etl/run_etl.pyload-summary.json, post-load-preview.png
Data quality reportAnalyst reviewing source defects before loadhonua-sdk[geopandas]python examples/data_quality_report.pydata-quality-report.json, data-quality-report.html
Spatial query cookbookDeveloper or analyst comparing protocol query patternscore SDK, optional honua-sdk[geopandas] for conversionspython examples/spatial_query_cookbook.pyprinted response-shape summary
Spatial analysis walkthroughAnalyst running buffer / spatial-join / dissolve on queried featureshonua-sdk[geopandas], optional matplotlib for the mapopen examples/notebooks/spatial_analysis_walkthrough.ipynb (or run the paired examples/notebooks/spatial_analysis_walkthrough.py)per-district summary table, optional map; runs offline on a bundled fixture
FastAPI spatial serviceApp developer exposing async Honua-backed API routesfastapi, uvicornuvicorn examples.fastapi_spatial_service:create_app --factory --reloadlocal /features and /summary routes
Async feature serviceApp developer fronting Honua with a pooled async clientfastapi, uvicornuvicorn examples.async_feature_service.service:create_app --factory --reloadlocal /services and /features routes
Protocol clientsSDK developer checking protocol wrapperscore SDK, optional honua-sdk[grpc] and honua-sdk[geopandas]python examples/protocol_clients.pyprinted protocol response examples
Geoprocessing job lifecycleDeveloper submitting one registered OGC process and collecting its resultcore SDKpython examples/geoprocessing_job_lifecycle.py --process-id <id> --inputs-json <json>job receipt and result JSON

Validation

Run the focused example tests from the repo root:

pytest tests/test_geospatial_etl_example.py tests/test_python_analyst_demos.py tests/test_spatial_analysis_example.py

The spatial-analysis walkthrough is notebook-first. Its logic lives in the importable examples/spatial_analysis/analysis.py, and the committed .ipynb is paired with a diff-friendly py:percent mirror (examples/notebooks/spatial_analysis_walkthrough.py). tests/test_spatial_analysis_example.py exercises the pure-Python helpers and verifies the notebook ships with cleared outputs. Notebook outputs are intentionally cleared; install jupytext if you want to keep the .ipynb/.py pair in sync automatically.

For cloud validation, set the environment variables above and run the scripts manually against a fixture service before attaching artifacts to issue or PR notes.