Skip to content

stac-utils/pgstacrs

Repository files navigation

pgstacrs

GitHub Actions Workflow Status GitHub Actions Workflow Status

Python async API for pgstac, backed by Rust. pgstacrs is tested against the following pgstac versions:

Usage

python -m pip install pgstacrs

Then:

from pgstacrs import Client

# Search
client = await Client.open("postgresql://username:password@localhost:5432/pgstac")
feature_collection = await client.search(
    collections=["collection-a"], # or collections="collection-a"
    intersects={"type": "Point", "coordinates": [-105.1019, 40.1672]},
    sortby="-datetime",
)

# CRUD
await client.create_item({"type": "Feature", "id": "foo", ...})
await client.delete_item("foo")
await client.create_items([...])

See the documentation for more.

Developing

Get Rust and uv. Then:

git clone [email protected]:stac-utils/pgstacrs.git
cd pgstacrs
uv sync
scripts/test

License

MIT