diff --git a/crates/api/CHANGELOG.md b/crates/api/CHANGELOG.md index 82f431ff..368129a5 100644 --- a/crates/api/CHANGELOG.md +++ b/crates/api/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Added + +- kwargs to Python search build ([#591](https://github.com/stac-utils/stac-rs/pull/591)) + ## [0.7.0] - 2025-01-02 ### Added diff --git a/crates/api/src/python.rs b/crates/api/src/python.rs index a3d3b734..793f8ab1 100644 --- a/crates/api/src/python.rs +++ b/crates/api/src/python.rs @@ -23,6 +23,7 @@ pub fn search<'py>( sortby: Option, filter: Option>, query: Option>, + kwargs: Option>, ) -> PyResult { let mut fields = Fields::default(); if let Some(include) = include { @@ -58,7 +59,7 @@ pub fn search<'py>( .map(|filter| filter.into_cql2_json()) .transpose() .map_err(Error::from)?; - let items = Items { + let mut items = Items { limit, bbox, datetime, @@ -68,6 +69,9 @@ pub fn search<'py>( filter, ..Default::default() }; + if let Some(kwargs) = kwargs { + items.additional_fields = pythonize::depythonize(&kwargs)?; + } let intersects = intersects .map(|intersects| match intersects {