restgdfΒΆ

Lightweight async Esri REST client with optional GeoPandas extras.

PyPI version Python versions Downloads License CI Publish to PyPI coverage llms.txt Ask DeepWiki Pydantic v2

restgdf is an async-first wrapper around Esri/ArcGIS REST Feature and Map services. The base install gives you typed metadata/query helpers, raw feature rows, crawl/auth utilities, and validated pydantic models for every response. Install restgdf[geo] when you want geopandas.GeoDataFrame and pandas-backed helpers on top of that light-core surface.

pip install restgdf
pip install "restgdf[geo]"

Planning a 2.x β†’ 3.x rollout? Treat the split above as the stable dependency boundary: geo-enabled environments should depend on restgdf[geo] explicitly. See restgdf migration guide for the upcoming optional-dependency notes and the preserved 1.x β†’ 2.0 guide.

GeoDataFrame workflow (requires restgdf[geo]):

import asyncio
from aiohttp import ClientSession
from restgdf import FeatureLayer

url = "https://maps1.vcgov.org/arcgis/rest/services/Beaches/MapServer/6"

async def main():
    async with ClientSession() as session:
        layer = await FeatureLayer.from_url(url, session=session)
        return await layer.get_gdf()

gdf = asyncio.run(main())

Explore the docsΒΆ

πŸš€ Quickstart

Install, connect to a FeatureServer, and choose between raw-row and GeoDataFrame workflows.

Quickstart
πŸ” Authentication

Pass ArcGIS tokens directly or let ArcGISTokenSession mint and refresh them for you.

Authentication
πŸ“¦ Pydantic models

Every ArcGIS response is a typed BaseModel β€” LayerMetadata, FeaturesResponse, CrawlReport, and more.

Pydantic models
πŸ“– API reference

FeatureLayer, Directory, ArcGISTokenSession, and the migration helpers in restgdf.compat.

API reference
πŸ›  Utilities

Low-level crawl, HTTP, token, raw-record, and GeoDataFrame helpers.

Utilities
Output adapters

Compose streaming primitives into dict, DataFrame, or GeoDataFrame shapes.

Output adapters
βš™οΈ Configuration

Layered config with RESTGDF_* env vars, frozen sub-configs, and sensible defaults.

Configuration
πŸ›‘ Resilience

Automatic retry, exponential back-off, and per-service-root rate limiting.

Resilience
πŸ“‘ Telemetry

OpenTelemetry spans, log correlation, and RestgdfInstrumentor.

Telemetry
⚠️ Error handling

Exception hierarchy, structured attributes, and recovery patterns.

Error handling
Migration notes

The upcoming 3.x geo-extra change and the preserved 1.x β†’ 2.0 rewrite table live here.

restgdf migration guide
πŸ€– Docs for LLMs

Every page is also published as plain Markdown (append .md to any URL), plus llms.txt / llms-full.txt indexes for RAG pipelines and coding agents.

https://restgdf.readthedocs.io/en/latest/llms.txt

Indices and tablesΒΆ