Skip to main content

georest

Stdlib-only Python clients for geospatial REST APIs — ArcGIS Image, Map and Feature Services, the USFS Enterprise Data Warehouse (EDW), ArcGIS Portal search, and the USGS Water Data OGC API.

Zero dependencies. Everything is urllib and json from the standard library. Nothing to resolve, nothing to pin, nothing to break — it installs cleanly into an ArcGIS Pro arcgispro-py3 clone, a locked-down agency environment, or a bare python:slim container.

pip install georest

Quick start

from georest.restesri import edw, portal, services

# Search the USFS EDW catalog by keyword or theme
hits = edw.search_edw_services("fire")

# Pull features as GeoJSON (layer 63 = "Burned Area Boundaries (All Years)")
geojson = edw.query_features(
    "EDW_MTBS_01", 63,
    where="fire_name LIKE '%CAMERON PEAK%'",
    out_fields="fire_name,acres,year",
)

# Search any ArcGIS Portal — IIPP, ArcGIS Online, USGS, NOAA, USFS, NASA,
# or any ArcGIS Enterprise install
results = portal.searchPortal("naip 2023", portal="agol")

# Generic ArcGIS service operations
tile_url = services.getImageServiceTileUrl("https://.../ImageServer")

# USGS Water Data: find gages in a box, pull a month of daily discharge
from georest.restusgs import waterdata

gages = waterdata.search_monitoring_locations(bbox=(-111.7, 36.8, -111.5, 37.0),
                                              site_type_code="ST")
fc = waterdata.get_daily_values("USGS-09380000", "00060",
                                start="2024-01-01", end="2024-01-31")
rows = waterdata.to_rows(fc)   # [{"time": "2024-01-01", "value": 9870.0, ...}, ...]

The provider modules are also re-exported at the top level, so from georest import edw and from georest import waterdata work too. They load lazily, so import georest costs almost nothing.

Layout

Import path What it covers
georest.restesri.edw USFS EDW: catalog search, layer-role tagging, FGDC/ISO metadata, feature and analytic queries
georest.restesri.portal ArcGIS Portal search and service metadata
georest.restesri.services Generic Image/Map/Feature Service queries and raster operations
georest.restusgs.waterdata USGS Water Data OGC API: monitoring locations, daily/continuous values, field measurements, peaks, time-series metadata

restesri is the Esri/ArcGIS provider and restusgs the USGS provider. Each sits under georest as a subpackage so providers can be added alongside one another without a namespace collision, and each is self-contained — its private _http (and, for restusgs, _ogc) module is its own.

Full per-function reference: docs/api.md. Runnable notebooks: examples/.

USGS API key

The Water Data API works anonymously, rate-limited to "a few queries per hour". For more, get a free key and set USGS_API_KEY in the environment (or call waterdata.set_api_key(...) once at startup). The key is sent only as the X-Api-Key header — never in a URL, so it cannot leak through an error message or a log line. Every result carries the remaining budget when the server reports it (fc["rate_limit"]), and a 429 the server won't let the client wait out raises waterdata.RateLimitError with a .retry_after rather than blocking.

Maintenance tool

georest-check-themes          # report drift vs. the live EDW catalog
georest-check-themes --emit   # + paste-ready _SERVICE_THEMES entries

edw._SERVICE_THEMES is hand-curated and powers theme filtering and description matching. EDW publishes and retires services without notice, so the table rots quietly — an untyped service still appears in search results, but as theme uncategorized with no description for keyword matching to reach. Exit status is 0 in sync, 1 drifted, 2 unreachable.

Migrating from RESTesri

This package was previously a loose RESTesri/ directory that worked only when the repository root happened to be on sys.path. Update imports:

from RESTesri import edw                    # before
from georest.restesri import edw            # after

from RESTesri._http import fetch_json       # before
from georest.restesri._http import fetch_json   # after

Then delete any sys.path.insert(...) bootstrap — pip install georest (or pip install -e . from a clone) makes it unnecessary.

Development

git clone https://github.com/redcastle-resources/georest
cd georest
pip install -e ".[dev]"

python -m pytest                              # or: python -m unittest discover -s tests -t .
EDW_LIVE=1 SERVICES_LIVE=1 USGS_LIVE=1 python -m pytest   # include the network tests

This is a src/ layout, so pip install -e . is required before the tests can import the package — that is deliberate. It makes the suite import the installed artifact rather than the source directory, so a packaging mistake fails loudly instead of being masked by the working directory.

Live tests skip rather than fail when the servers are unreachable; EDW intermittently answers 404, 500, Layer not found, or 200-with-no-layers for services that work moments later, and the USGS API rate-limits anonymous callers. See tests/README.md and CONTRIBUTING.md.

Requirements

Python 3.9 or newer. The 3.9 floor is deliberate: ArcGIS Pro 3.0–3.2 ships Python 3.9, and that is squarely this library's audience.

License

Apache License 2.0 — see LICENSE.

portal.py and services.py were ported from geeViz's esriLib.py, with the viewer-rendering functions removed; these modules fetch data rather than render it.

Release files for georest 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for georest 0.3.0
File Size Uploaded
georest-0.3.0.tar.gz 232.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for georest 0.3.0
File Interpreter ABI Platform
georest-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 315.5 kB

Release files / georest-0.3.0.tar.gz

Download URL georest-0.3.0.tar.gz
Size 232.5 kB
Tags Source
SHA-256 checksum
How to use checksums
80182802cecc1c93cb8195d277a4dff63b144da4edb31aeba028084222a49f3f
BLAKE2b-256 checksum
How to use checksums
2c58cb8e93187ebd86452d8819c9e3d820495ec7128c35ca892b5c3c87dc390d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / georest-0.3.0-py3-none-any.whl

Download URL georest-0.3.0-py3-none-any.whl
Size 83.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c00ff39383c369d50f19fcf024c8dc1ebd3d0867eee55224228de6f749996beb
BLAKE2b-256 checksum
How to use checksums
0672b93781491f796e83826f88482871ed49846f8e18a22b571ce822787cac77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page