Installation

pip install georest

georest needs Python 3.9 or newer, and pandas, which the Forest Service clients use to return DataFrames. The Esri and USGS clients use only the standard library. The 3.9 floor is deliberate: ArcGIS Pro 3.0 to 3.2 ship Python 3.9, with pandas, and ArcGIS Pro users are a core audience.

To summarize LCMS over your own polygon, add Earth Engine:

pip install "georest[ee]"

Note

georest.usfs is on the main branch and not yet in a release on PyPI. Until it is, install from GitHub:

pip install "georest @ git+https://github.com/redcastle-resources/georest"

ArcGIS Pro

Install into a clone of Pro’s arcgispro-py3 environment, not the default environment itself, which Pro does not let you modify:

conda create --clone arcgispro-py3 --name georest-pro
activate georest-pro
pip install georest

From source

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

georest uses a src/ layout, so the editable install is required before the tests can import it. That is intentional: the tests import the installed package rather than the source folder, so a packaging mistake fails loudly instead of being hidden by the working directory.

Run the tests with:

python -m pytest
EDW_LIVE=1 SERVICES_LIVE=1 USGS_LIVE=1 python -m pytest   # include the network tests

Live tests skip rather than fail when a server is unreachable. EDW sometimes answers with a 404, a 500, Layer not found or an empty layer list for services that work moments later, and the USGS API rate-limits anonymous callers.

Command-line tools

Installing georest adds two commands:

georest-login

Signs in to ArcGIS Online or a Portal from a terminal and saves a refresh token for later processes. See Authentication.

georest-check-themes

Reports drift between georest’s curated EDW theme table and the live EDW catalog. EDW adds and retires services without notice; a service missing from the table still appears in search results, but as uncategorized and without a description for keyword search to match. Add --emit for ready-to-paste table entries. The exit status is 0 when in sync, 1 when drifted and 2 when EDW is unreachable.