API Reference¶
Top-Level API¶
Entry points for opening a catalog, ingesting data, and searching.
earthcatalog.catalog
¶
Catalog lifecycle and grid metadata.
- :class:
CatalogInfo— grid metadata read from Iceberg table properties, owning the read-side partitioner (spatial prune + temporal bin). open()/get_or_create()/download_catalog/upload_catalog— the catalog db lifecycle (open, create, persist).- :class:
EarthCatalog— re-exported from :mod:earthcatalog.facade, where the user-facing facade lives.
Functions¶
open(store, base, *, anonymous=None)
¶
Open an EarthCatalog backed by store at base.
Parameters¶
store:
An obstore-compatible store (S3Store, LocalStore, etc.).
All catalog I/O (download, upload) and warehouse file operations
flow through this store.
base:
Base path containing:
- earthcatalog.db (SQLite Iceberg catalog)
- warehouse/ (GeoParquet files)
Optionally:
- warehouse_index.parquet (unified index)
anonymous:
Force anonymous S3 access when the warehouse path is s3://.
Auto-detected for stores with skip_signature=True.
Returns¶
EarthCatalog Facade combining PyIceberg catalog, table, and grid metadata.
Source code in earthcatalog/catalog.py
earthcatalog.catalog.EarthCatalog
¶
Simplified facade for querying an EarthCatalog.
Combines PyIceberg catalog, table, and CatalogInfo into a single interface for spatial/temporal queries with automatic file pruning.
Example::
from earthcatalog import open as ec_open
from obstore.store import S3Store
from shapely.geometry import Point
store = S3Store(bucket='my-bucket', region='us-west-2')
ec = ec_open(store=store, base='s3://my-bucket/catalog')
point = Point(-133.99, 58.74)
paths = ec.search_files(point, start_datetime='2020-01-01')
Source code in earthcatalog/facade.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
Attributes¶
info
property
¶
Grid metadata + pruning for this catalog.
Functions¶
ingest_inventory(inventory_path, *, mode='auto', config=None)
¶
Ingest an inventory using a (optionally distributed) Dask cluster.
Delegates to :class:earthcatalog.pipeline.IngestPipeline. config
(a :class:earthcatalog.ingest_config.IngestConfig) holds the tuning
knobs (chunk size, compact rows, stage, resume flags, create_client).
There is one ingest operation: mode only controls table handling —
"full" drops and rebuilds the Iceberg table, "delta" appends,
"auto" appends iff the table has rows. Input scope (complete
inventory vs. newer snapshot vs. precomputed delta parquet) is simply
which inventory_path you pass; the unified index dedups source
keys, so every run is resumable and idempotent.
With stage="ndjson" (default) items are staged to per-(cell,
year) NDJSON before a memory-bounded compaction to GeoParquet;
skip_fetch resumes from the staged NDJSON. Distributed runs
shard the inventory by part file where possible — workers stream
their own files and only the head node commits.
Returns the run summary dict ({"items": …, "rows": …}).
Source code in earthcatalog/facade.py
search(**kwargs)
¶
Search across the catalog, returning a deferred EarthCatalogItemSearch.
Accepts the same kwargs as :func:rustac.search:
intersects, bbox, datetime, filter (CQL2 JSON),
ids, collections, max_items, limit, sortby,
include, exclude, query, etc.
Use the top-level datetime kwarg for temporal filtering. Do
not reference datetime inside the CQL2 filter —
rustac generates broken SQL when datetime appears in a CQL2
expression.
Performance¶
For fastest results use :func:earthcatalog.search.duck_search
(DuckDB parallel I/O, ~2× faster across all query types).
search() and search_to_arrow() use rustac (sequential per-file)
and have comparable speed. See :doc:/operations/search_performance
for detailed benchmarks.
Returns¶
EarthCatalogItemSearch
A lazy, pystac_client-compatible search result. No I/O until
items(), item_collection(), or pages() is called.
Source code in earthcatalog/facade.py
search_to_arrow(**kwargs)
¶
Search across the catalog, returning a PyArrow table.
Source code in earthcatalog/facade.py
search_files(geom, start_datetime=None, end_datetime=None)
¶
Return Parquet file paths for partitions intersecting geom.
Source code in earthcatalog/facade.py
Modules¶
| Module | Description |
|---|---|
earthcatalog |
Catalog, search, transform, lock, schema |
earthcatalog.grids |
Spatial partitioners (H3, GeoJSON) |
earthcatalog.pipelines |
Ingest pipelines |
earthcatalog.maintenance |
Warehouse compaction |