https://github.com/stac-utils/pgstacrs
Python async API for pgstac, backed by Rust
https://github.com/stac-utils/pgstacrs
pgstac postgres python stac
Last synced: 10 months ago
JSON representation
Python async API for pgstac, backed by Rust
- Host: GitHub
- URL: https://github.com/stac-utils/pgstacrs
- Owner: stac-utils
- License: mit
- Created: 2024-11-22T21:01:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T12:00:12.000Z (over 1 year ago)
- Last Synced: 2025-07-11T12:05:53.884Z (11 months ago)
- Topics: pgstac, postgres, python, stac
- Language: Python
- Homepage: https://stac-utils.github.io/pgstacrs/
- Size: 1.56 MB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pgstacrs
[](https://github.com/stac-utils/pgstacrs/actions/workflows/ci.yml)
[](https://stac-utils.github.io/pgstacrs)
Python async API for [pgstac](https://github.com/stac-utils/pgstac), backed by Rust.
**pgstacrs** is tested against the following **pgstac** versions:
- [0.9.1](https://github.com/stac-utils/pgstac/releases/tag/v0.9.1)
- [0.8.5](https://github.com/stac-utils/pgstac/releases/tag/v0.8.5)
## Usage
```shell
python -m pip install pgstacrs
```
Then:
```python
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](https://stac-utils.github.io/pgstacrs/) for more.
## Developing
Get [Rust](https://rustup.rs/) and [uv](https://docs.astral.sh/uv/getting-started/installation/).
Then:
```shell
git clone git@github.com:stac-utils/pgstacrs.git
cd pgstacrs
uv sync
scripts/test
```
## License
MIT