From a969cf94c9bb8fa3ab485d7959bcec4a82804959 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Fri, 16 Apr 2021 19:03:19 -0400 Subject: [PATCH 1/5] update CHANGELOG and version --- .flake8 | 1 - CHANGELOG.md | 8 +++++--- pystac_client/version.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index c33acaff..d559d456 100644 --- a/.flake8 +++ b/.flake8 @@ -15,4 +15,3 @@ ignore = E126,E127,W503 exclude = docs/build - .tox diff --git a/CHANGELOG.md b/CHANGELOG.md index 96c6309d..fef020e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.1.1] - 2021-04-16 + ### Added - `ItemSearch.items_as_collection` [#37](https://github.com/stac-utils/pystac-client/pull/37) @@ -13,17 +15,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Include headers in STAC_IO [#38](https://github.com/stac-utils/pystac-client/pull/38) +- README updated to reflect actual CLI behavior ### Changed - CLI: pass in heades as list of KEY=VALUE pairs -### Removed - ## [v0.1.0] - 2021-04-14 Initial release. -[Unreleased]: +[Unreleased]: +[v0.1.1]: [v0.1.0]: diff --git a/pystac_client/version.py b/pystac_client/version.py index b794fd40..df9144c5 100644 --- a/pystac_client/version.py +++ b/pystac_client/version.py @@ -1 +1 @@ -__version__ = '0.1.0' +__version__ = '0.1.1' From 3875c4519b6f71e612a49daa947a66fef44cf532 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Fri, 16 Apr 2021 19:34:00 -0400 Subject: [PATCH 2/5] README updates --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8ed543a1..0a6f3469 100644 --- a/README.md +++ b/README.md @@ -30,31 +30,38 @@ $ stac-client search --url https://earth-search.aws.element84.com/v0 -c sentinel 1999 items matched ``` +The `--matched` switch performs a search with limit=0 so does not get any Items, but gets the total number of +matches which will be output to the screen. + The environment variable `STAC_URL` can be set instead of having to explicitly set the Catalog URL with every call: ``` $ export STAC_URL=https://earth-search.aws.element84.com/v0 -$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 +$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 --matched 48 items matched ``` -The CLI performs a search with limit=0 so does not get any Items, it only gets the count. To fetch the items use one or both of the `--stdout` or `--save` switches. - -Specifying `--stdout` will fetch all items, paginating if necessary. If `max_items` is provided it will stop paging once that many items has been retrieved. It then prints all items to stdout as an ItemCollection. This can be useful to pipe output to another process such as [stac-terminal](https://github.com/stac-utils/stac-terminal), [geojsonio-cli](https://github.com/mapbox/geojsonio-cli), or [jq](https://stedolan.github.io/jq/). +Without the `--matched` switch, all items will be fetched, paginating if necessary. If `max_items` is provided +it will stop paging once that many items has been retrieved. It then prints all items to stdout as an ItemCollection. +This can be useful to pipe output to another process such as [stac-terminal](https://github.com/stac-utils/stac-terminal), +[geojsonio-cli](https://github.com/mapbox/geojsonio-cli), or [jq](https://stedolan.github.io/jq/). ``` -$ stac-client search --stdout -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 | stacterm cal --label platform +$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 | stacterm cal --label platform ``` ![](docs/source/images/stacterm-cal.png) -The `--save` switch will save all fetched items (as with `--stdout`) to a file. +If the `--save` switch is provided instead, the results will not be output to stdout, but instead will be saved to +the specified file. ``` $ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 --save items.json ``` -If the Catalog supports the [Query extension](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query), any Item property can also be included in the search. Rather than requiring the JSON syntax the Query extension uses, pystac-client uses a simpler syntax that it will translate to the JSON equivalent. +If the Catalog supports the [Query extension](https://github.com/radiantearth/stac-api-spec/tree/master/fragments/query), +any Item property can also be included in the search. Rather than requiring the JSON syntax the Query extension uses, +pystac-client uses a simpler syntax that it will translate to the JSON equivalent. ``` @@ -71,7 +78,7 @@ view:sun_elevation<20 Any number of properties can be included, and each can be included more than once to use additional operators. ``` -$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 -q "eo:cloud_cover<10" +$ stac-client search -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 -q "eo:cloud_cover<10" --matched 10 items matched ``` From 87949b2a94cce1b3e83882ec60f7c2c187ae9b62 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Fri, 16 Apr 2021 19:35:36 -0400 Subject: [PATCH 3/5] add STAC link to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a6f3469..62d4e534 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ STAC API Client [![Documentation](https://readthedocs.org/projects/pystac_client/badge/?version=latest)](https://pystac_client.readthedocs.io/en/latest/) [![codecov](https://codecov.io/gh/stac-utils/pystac-client/branch/main/graph/badge.svg)](https://codecov.io/gh/stac-utils/pystac-client) -A Python client for working with STAC Catalogs and APIs. +A Python client for working with [STAC](https://stacspec.org/) Catalogs and APIs. ## Installation From d9a82f05e70fe82dabf09733a6f8c5fb2b35f2ed Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Fri, 16 Apr 2021 19:40:38 -0400 Subject: [PATCH 4/5] fix failing test due to version --- tests/test_pystac_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pystac_api.py b/tests/test_pystac_api.py index dea261c6..b57b785d 100644 --- a/tests/test_pystac_api.py +++ b/tests/test_pystac_api.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == '0.1.0' + assert __version__ == '0.1.1' From 5beb4555faa453cf8b3a6665c70e611db259ef23 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Fri, 16 Apr 2021 19:54:52 -0400 Subject: [PATCH 5/5] update license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index be961435..414c8642 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2021 [name of copyright owner] +Copyright 2021 Jon Duckworth Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.