Skip to content

Commit 49165b0

Browse files
authored
release: v0.5.6 (#59)
1 parent 2520ed1 commit 49165b0

File tree

9 files changed

+70
-48
lines changed

9 files changed

+70
-48
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9-
## [0.5.6-beta.1] - 2025-02-25
9+
## [0.5.6] - 2025-02-26
1010

1111
### Added
1212

@@ -149,8 +149,8 @@ Non-functional release to fix releasing from Github actions.
149149

150150
Initial release.
151151

152-
[Unreleased]: https://github.com/gadomski/stacrs/compare/v0.5.6-beta.1...main
153-
[0.5.6-beta.1]: https://github.com/gadomski/stacrs/compare/v0.5.5...v0.5.6-beta.1
152+
[Unreleased]: https://github.com/gadomski/stacrs/compare/v0.5.6...main
153+
[0.5.6]: https://github.com/gadomski/stacrs/compare/v0.5.5...v0.5.6
154154
[0.5.5]: https://github.com/gadomski/stacrs/compare/v0.5.4...v0.5.5
155155
[0.5.4]: https://github.com/gadomski/stacrs/compare/v0.5.3...v0.5.4
156156
[0.5.3]: https://github.com/gadomski/stacrs/compare/v0.5.2...v0.5.3

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to **stacrs**
1+
# Contributing
22

33
First off, thanks for contributing!
44
We appreciates you.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stacrs"
3-
version = "0.5.6-beta.1"
3+
version = "0.5.6"
44
edition = "2021"
55
publish = false
66

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
![PyPI - License](https://img.shields.io/pypi/l/stacrs?style=for-the-badge)
88
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](./CODE_OF_CONDUCT)
99

10-
A small no-dependency Python package for [STAC](https://stacspec.org/), using Rust under the hood.
10+
A Python package for [STAC](https://stacspec.org/) using Rust under the hood.
1111

1212
## Why?
1313

14-
Q: We already have [PySTAC](https://github.com/stac-utils/pystac), so why did we make a new STAC Python library?
14+
Q: We already have [PySTAC](https://github.com/stac-utils/pystac), so why **stacrs**?
1515

16-
A: We want to provide a couple of things in [stac-rs](https://github.com/stac-utils/stac-rs) (a collection of STAC Rust libraries) to the Python ecosystem:
16+
A: **stacrs** can
1717

1818
- Read, write, and search [stac-geoparquet](https://github.com/stac-utils/stac-geoparquet)
19-
- `async` functions
19+
- Go to and from [arrow](https://arrow.apache.org/) tables, allowing easy interoperability with (e.g.) [GeoPandas](https://geopandas.org/en/stable/)
20+
- `async`
2021

21-
If you don't need those things, **stacrs** probably isn't for you — use **pystac** and its friend, [pystac-client](https://github.com/stac-utils/pystac-client), instead.
22+
If you don't need those things, **stacrs** probably isn't for you — use **pystac** and its friend, [pystac-client](https://github.com/stac-utils/pystac-client).
2223

2324
## Usage
2425

@@ -28,7 +29,7 @@ Install via **pip**:
2829
# basic
2930
python -m pip install stacrs
3031

31-
# add methods to return arrow tables
32+
# support arrow tables
3233
python -m pip install 'stacrs[arrow]'
3334
```
3435

@@ -56,6 +57,7 @@ items = await stacrs.search(
5657
from geopandas import GeoDataFrame
5758
table = await stacrs.search_to_arrow(...)
5859
data_frame = GeoDataFrame.from_arrow(table)
60+
items = stacrs.from_arrow(data_frame.to_arrow())
5961

6062
# Write items to a stac-geoparquet file
6163
await stacrs.write("items.parquet", items)
@@ -117,17 +119,9 @@ Options:
117119
> [!NOTE]
118120
> Before **stacrs** v0.5.4, the CLI was its own PyPI package named **stacrs-cli**, which is no longer needed.
119121
120-
## Comparisons
122+
## stac-geoparquet
121123

122-
This package (intentionally) has limited functionality, as it is _not_ intended to be a replacement for existing Python STAC packages.
123-
[pystac](https://pystac.readthedocs.io) is a mature Python library with a significantly richer API for working with STAC objects.
124-
For querying STAC APIs, [pystac-client](https://pystac-client.readthedocs.io) is more feature-rich than our simplistic `stacrs.search`.
125-
126-
That being said, it is hoped that **stacrs** will be a nice complement to the existing Python STAC ecosystem by providing a no-dependency package with unique capabilities, such as searching directly into a stac-geoparquet file.
127-
128-
### stac-geoparquet
129-
130-
**stacrs** also replicates much of the behavior in the [stac-geoparquet](https://github.com/stac-utils/stac-geoparquet) library, and even uses some of the same Rust dependencies.
124+
**stacrs** replicates much of the behavior in the [stac-geoparquet](https://github.com/stac-utils/stac-geoparquet) library, and even uses some of the same Rust dependencies.
131125
We believe there are a couple of issues with **stac-geoparquet** that make **stacrs** a worthy replacement:
132126

133127
- The **stac-geoparquet** repo includes Python dependencies
@@ -149,6 +143,10 @@ scripts/test
149143

150144
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing to this project.
151145

146+
> [!TIP]
147+
> We ship our wheels with **libduckdb** so users don't have to worry about having it installed.
148+
> You only need it if you're doing development.
149+
152150
### DuckDB
153151

154152
By default, this package expects **libduckdb** to be present on your system.

docs/api/arrow.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
description: Go to and from arrow
3+
---
4+
5+
# Arrow
6+
7+
These functions require the `arrow` extra, e.g.:
8+
9+
```shell
10+
python -m pip install 'stacrs[arrow]'
11+
```
12+
13+
::: stacrs.to_arrow
14+
::: stacrs.from_arrow

docs/example.ipynb

Lines changed: 15 additions & 11 deletions
Large diffs are not rendered by default.

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ nav:
2020
- Example notebook: example.ipynb
2121
- API:
2222
- api/index.md
23+
- arrow: api/arrow.md
2324
- duckdb: api/duckdb.md
2425
- migrate: api/migrate.md
2526
- read: api/read.md
@@ -47,6 +48,8 @@ plugins:
4748
show_source: false
4849
show_symbol_type_toc: true
4950
signature_crossrefs: true
51+
import:
52+
- https://kylebarron.dev/arro3/latest/objects.inv
5053
- search
5154
- social:
5255
cards_layout_options:

stacrs.pyi

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class DuckdbClient:
6363
kwargs: Additional parameters to pass in to the search.
6464
6565
Returns:
66-
dict[str, Any]: A feature collection of STAC items.
66+
A feature collection of STAC items.
6767
"""
6868

6969
def search_to_arrow(
@@ -86,9 +86,13 @@ class DuckdbClient:
8686
) -> arro3.core.Table | None:
8787
"""Search a stac-geoparquet file with duckdb, returning an arrow table
8888
suitable for loading into (e.g.) GeoPandas.
89+
8990
**stacrs** must be installed with the `arrow` extra, e.g. `python -m pip
9091
*install 'stacrs[arrow]'.
9192
93+
Because DuckDB has arrow as a core output format, this can be more
94+
performant than going through a JSON dictionary.
95+
9296
Args:
9397
href: The stac-geoparquet file.
9498
ids: Array of Item ids to return.
@@ -115,7 +119,7 @@ class DuckdbClient:
115119
kwargs: Additional parameters to pass in to the search.
116120
117121
Returns:
118-
arro3.core.Table | None: An arrow table, or none if no records were returned.
122+
An arrow table, or none if no records were returned.
119123
120124
Examples:
121125
>>> table = client.search_to_arrow("data/100-sentinel-2-items.parquet")
@@ -180,7 +184,7 @@ def migrate(value: dict[str, Any], version: Optional[str] = None) -> dict[str, A
180184
value will be migrated to the latest stable version.
181185
182186
Returns:
183-
dict[str, Any]: The migrated dictionary
187+
The migrated dictionary
184188
185189
Examples:
186190
>>> with open("examples/simple-item.json") as f:
@@ -206,7 +210,7 @@ async def read(
206210
object store, e.g. your AWS credentials.
207211
208212
Returns:
209-
dict[str, Any]: The STAC value
213+
The STAC value
210214
211215
Examples:
212216
>>> item = await stacrs.read("item.json")
@@ -216,30 +220,30 @@ def from_arrow(
216220
table: arro3.core.Table,
217221
) -> dict[str, Any]:
218222
"""
219-
Converts an [arro3.core.table][] to a STAC item collection.
223+
Converts an [arro3.core.Table][] to a STAC item collection.
220224
221225
Requires **stacrs** to be installed with the `arrow` extra.
222226
223227
Args:
224228
table: The table
225229
226230
Returns:
227-
dict[str, Any]: The STAC item collection
231+
The STAC item collection
228232
"""
229233

230234
def to_arrow(
231235
items: list[dict[str, Any]] | dict[str, Any],
232236
) -> arro3.core.Table:
233237
"""
234-
Converts items to an [arro3.core.table][].
238+
Converts items to an [arro3.core.Table][].
235239
236240
Requires **stacrs** to be installed with the `arrow` extra.
237241
238242
Args:
239-
items: Either an iterable of items or a item collection
243+
items: Either a list of items or a item collection
240244
241245
Returns:
242-
arro3.core.Table: The table
246+
The table
243247
"""
244248

245249
async def search(
@@ -298,7 +302,7 @@ async def search(
298302
kwargs: Additional parameters to pass in to the search.
299303
300304
Returns:
301-
list[dict[str, Any]]: A list of the returned STAC items.
305+
A list of the returned STAC items.
302306
303307
Examples:
304308
>>> items = await stacrs.search(
@@ -372,7 +376,7 @@ async def search_to(
372376
to None.
373377
374378
Returns:
375-
int: The number of items written
379+
The number of items written
376380
377381
Examples:
378382
>>> count = await stacrs.search_to("out.parquet",
@@ -404,9 +408,8 @@ async def write(
404408
object store, e.g. your AWS credentials.
405409
406410
Returns:
407-
dict[str, str] | None: The result of putting data into an object store,
408-
e.g. the e_tag and the version. None is returned if the file was written
409-
locally.
411+
The result of putting data into an object store, e.g. the e_tag and the
412+
version. None is returned if the file was written locally.
410413
411414
Examples:
412415
>>> with open("items.json") as f:
@@ -423,7 +426,7 @@ def version(name: str | None = None) -> str | None:
423426
values are "stac", "stac-api", "stac-duckdb", or "duckdb".
424427
425428
Returns:
426-
str: The version, or None if the name is not recognized as an upstream.
429+
The version, or None if the name is not recognized as an upstream.
427430
428431
Examples:
429432
>>> stacrs.version()

0 commit comments

Comments
 (0)