Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.5.0 #117

Merged
merged 6 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

## Unreleased

### Changed

## [v1.5.0] - 2025-01-17

### Added

- Allow to provide HTTP headers ([#114](https://github.com/stac-utils/stac-check/pull/114))
Expand Down Expand Up @@ -163,7 +167,8 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
- Validation from stac-validator 2.3.0
- Links and assets validation checks

[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.4.0...main
[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.5.0...main
[v1.5.0]: https://github.com/stac-utils/stac-check/compare/v1.4.0...v1.5.0
[v1.4.0]: https://github.com/stac-utils/stac-check/compare/v1.3.3...v1.4.0
[v1.3.3]: https://github.com/stac-utils/stac-check/compare/v1.3.2...v1.3.3
[v1.3.2]: https://github.com/stac-utils/stac-check/compare/v1.3.1...v1.3.2
Expand Down
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# stac-check

## A linting and validation tool for STAC assets

The intent of this project is to provide a validation tool that also follows the official [STAC Best Practices document](https://github.com/radiantearth/stac-spec/blob/master/best-practices.md)

---

### Documentation

[stac-check.readthedocs.io](https://stac-check.readthedocs.io/en/latest/)

---

### Install

`$ pip install stac-check`

or for local development

`$ pip install -e '.[dev]'`

---

### CLI Usage

```
Usage: stac-check [OPTIONS] FILE

Expand All @@ -34,14 +41,18 @@ Options:
multiple times.
--help Show this message and exit. Show this message and exit.
```

---

### Docker

```
$ make build
$ make shell
```

---

### Lint JSON

```
Expand All @@ -52,10 +63,13 @@ linter = Linter('<json_path>')
for k, v in linter.create_best_practices_dict().items():
print(k, ":", v)
```

---

### CLI Examples

``` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ```
`stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive`

```
____ ____ __ ___ ___ _ _ ____ ___ __ _
/ ___)(_ _)/ _\ / __)___ / __)/ )( \( __)/ __)( / )
Expand All @@ -64,7 +78,7 @@ for k, v in linter.create_best_practices_dict().items():

stac-check: STAC spec validation and linting tool

Please upgrade from version 0.9.0 to version 1.0.0!
Please upgrade from version 0.9.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand Down Expand Up @@ -100,11 +114,11 @@ Error Message: Expecting value: line 1 column 1 (char 0)
-------------------------
```

``` stac-check sample_files/0.9.0/landsat8-sample.json```
` stac-check sample_files/0.9.0/landsat8-sample.json`

<pre><b>stac-check: STAC spec validation and linting tool</b>

Please upgrade from version 0.9.0 to version 1.0.0!
Please upgrade from version 0.9.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand All @@ -128,11 +142,12 @@ STAC Best Practices:
This object has 4 links
</pre>

``` stac-check sample_files/1.0.0/core-item.json --assets```
` stac-check sample_files/1.0.0/core-item.json --assets`

<pre>
<b>stac-check: STAC spec validation and linting tool</b>

Thanks for using STAC version 1.0.0!
Please upgrade from version 1.0.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand Down Expand Up @@ -161,13 +176,12 @@ ASSET request errors:
This object has 4 links
</pre>

` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets`


``` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets```
<pre>
<b>stac-check: STAC spec validation and linting tool</b>

Thanks for using STAC version 1.0.0!
Please upgrade from version 1.0.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand Down Expand Up @@ -205,11 +219,12 @@ LINK request errors:
This object has 4 links
</pre>

``` stac-check sample_files/0.9.0/bad-item.json```
` stac-check sample_files/0.9.0/bad-item.json`

<pre>
<b>stac-check: STAC spec validation and linting tool</b>

Please upgrade from version 0.9.0 to version 1.0.0!
Please upgrade from version 0.9.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand All @@ -229,11 +244,12 @@ Validation error message:
This object has 5 links
</pre>

``` stac-check https://stac-catalog.eu/collections/sentinel-s2-l2a/items/item1 --assets --no-assets-urls --header x-api-key $MY_API_KEY --header foo bar```
` stac-check https://stac-catalog.eu/collections/sentinel-s2-l2a/items/item1 --assets --no-assets-urls --header x-api-key $MY_API_KEY --header foo bar`

<pre>
<b>stac-check: STAC spec validation and linting tool</b>

Thanks for using STAC version 1.0.0!
Please upgrade from version 1.0.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Expand All @@ -252,6 +268,9 @@ No ASSET format errors!

This object has 4 links
</pre>

---

### Create local docs in the /docs folder

`$ pdoc --output-dir pdoc ./stac_check`
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

project = "stac-check"
author = "Jonathan Healy"
release = "1.3.1"
release = "1.5.0"


# -- General configuration ---------------------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ CLI Usage
-l, --links Validate links for format and response.
-a, --assets Validate assets for format and response.
-m, --max-depth INTEGER Maximum depth to traverse when recursing. Omit this
argument to get full recursion. Ignored if
`recursive == False`.
argument to get full recursion. Ignored if
`recursive == False`.
-r, --recursive Recursively validate all related stac objects.
--help Show this message and exit.
--no-assets-urls Disables the opening of href links when validating assets
(enabled by default).
--header KEY VALUE HTTP header to include in the requests. Can be used
multiple times.
--help Show this message and exit. Show this message and exit.

Examples
~~~~~~~~
Expand Down Expand Up @@ -91,7 +95,7 @@ STAC Versions supported

``stac-check`` supports the following STAC versions:

``[0.8.0, 0.8.1, 0.9.0, 1.0.0-beta.1, 1.0.0-beta.2, 1.0.0-rc.1, 1.0.0-rc.2, 1.0.0-rc.3, 1.0.0-rc.4, 1.0.0]``
``[0.8.0, 0.8.1, 0.9.0, 1.0.0-beta.1, 1.0.0-beta.2, 1.0.0-rc.1, 1.0.0-rc.2, 1.0.0-rc.3, 1.0.0-rc.4, 1.0.0, 1.1.0]``

.. toctree::
:maxdepth: 1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import find_packages, setup

__version__ = "1.4.0"
__version__ = "1.5.0"

with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down
2 changes: 1 addition & 1 deletion stac_check/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def intro_message(linter: Linter) -> None:

click.secho()

if linter.version == "1.0.0":
if linter.version == "1.1.0":
click.secho(linter.set_update_message(), fg="green")
else:
click.secho(linter.set_update_message(), fg="red")
Expand Down
6 changes: 3 additions & 3 deletions stac_check/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ def set_update_message(self) -> str:
Returns:
A string containing a message for users to update their STAC version.
"""
if self.version != "1.0.0":
return f"Please upgrade from version {self.version} to version 1.0.0!"
if self.version != "1.1.0":
return f"Please upgrade from version {self.version} to version 1.1.0!"
else:
return "Thanks for using STAC version 1.0.0!"
return "Thanks for using STAC version 1.1.0!"

def check_links_assets(
self, num_links: int, url_type: str, format_type: str
Expand Down
Loading