Skip to content
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
rev: 24.1.1
hooks:
- id: black
language_version: python3.10
language_version: python3.12
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

### Added

- Added sponsors and supporters section with logos ([#122](https://github.com/stac-utils/stac-check/pull/122))

### Updated

- Improved README with table of contents, better formatting, stac-check logo, and enhanced documentation ([#122](https://github.com/stac-utils/stac-check/pull/122))
- Enhanced Contributing guidelines with step-by-step instructions ([#122](https://github.com/stac-utils/stac-check/pull/122))

## [v1.6.0] - 2025-03-14

### Added
Expand Down
222 changes: 158 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,72 @@
# stac-check

<!-- markdownlint-disable MD033 MD041 -->

<p align="left">
<img src="assets/stac-check.png" width=560>
</p>

[![Downloads](https://static.pepy.tech/badge/stac-check?color=blue)](https://pepy.tech/project/stac-check)
[![GitHub contributors](https://img.shields.io/github/contributors/stac-utils/stac-check?color=blue)](https://github.com/stac-utils/stac-check/graphs/contributors)
[![GitHub stars](https://img.shields.io/github/stars/stac-utils/stac-check.svg?color=blue)](https://github.com/stac-utils/stac-check/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/stac-utils/stac-check.svg?color=blue)](https://github.com/stac-utils/stac-check/network/members)
[![PyPI version](https://img.shields.io/pypi/v/stac-check.svg?color=blue)](https://pypi.org/project/stac-check/)
[![STAC](https://img.shields.io/badge/STAC-1.1.0-blue.svg)](https://github.com/radiantearth/stac-spec/tree/v1.1.0)

## 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
## Table of Contents

- [Documentation](#documentation)
- [Installation](#installation)
- [Pip](#pip)
- [Docker](#docker)
- [Usage](#usage)
- [CLI Usage](#cli-usage)
- [Python API Usage](#python-api-usage)
- [Examples](#examples)
- [Basic Validation](#basic-validation)
- [Recursive Validation](#recursive-validation)
- [Asset Validation](#asset-validation)
- [Link and Asset Validation](#link-and-asset-validation)
- [Invalid STAC](#invalid-stac)
- [Using HTTP Headers](#using-http-headers)
- [Development](#development)
- [Sponsors and Supporters](#sponsors-and-supporters)
- [Contributing](#contributing)
- [How to Contribute](#how-to-contribute)
- [Development Guidelines](#development-guidelines)
- [Reporting Issues](#reporting-issues)
- [License](#license)

## Documentation

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

---
## Installation

### Install
### Pip

`$ pip install stac-check`
```bash
$ pip install stac-check
```

or for local development
For local development:

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

---
### Docker

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

## Usage

### CLI Usage

Expand All @@ -39,44 +85,61 @@ Options:
(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.
--help Show this message and exit.
```

---
### Python API Usage

### Docker
```python
from stac_check.lint import Linter

```
$ make build
$ make shell
linter = Linter('<json_path>')

for k, v in linter.create_best_practices_dict().items():
print(k, ":", v)
```

---
## Examples

### Lint JSON
### Basic Validation

```bash
stac-check sample_files/0.9.0/landsat8-sample.json
```
from stac_check.lint import Linter

linter = Linter('<json_path>')
<pre><b>stac-check: STAC spec validation and linting tool</b>

for k, v in linter.create_best_practices_dict().items():
print(k, ":", v)
```
Please upgrade from version 0.9.0 to version 1.1.0!

Validator: stac-validator 3.5.0

Valid ITEM: True

Schemas validated:
https://cdn.staclint.com/v0.9.0/extension/eo.json
https://cdn.staclint.com/v0.9.0/extension/view.json
https://cdn.staclint.com/v0.9.0/item.json

---
STAC Best Practices:
Item name 'LC81530252014153LGN00' should only contain Searchable identifiers
Identifiers should consist of only lowercase characters, numbers, '_', and '-'
https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers

Item file names should match their ids: 'landsat8-sample' not equal to 'LC81530252014153LGN00

### CLI Examples
A link to 'self' in links is strongly recommended


This object has 4 links
</pre>

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

```bash
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: STAC spec validation and linting tool
<pre><b>stac-check: STAC spec validation and linting tool</b>

Please upgrade from version 0.9.0 to version 1.1.0!

Expand Down Expand Up @@ -112,37 +175,14 @@ Schemas validated:
Error Type: JSONDecodeError
Error Message: Expecting value: line 1 column 1 (char 0)
-------------------------
```

` 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.1.0!

Validator: stac-validator 3.5.0

Valid ITEM: True

Schemas validated:
https://cdn.staclint.com/v0.9.0/extension/eo.json
https://cdn.staclint.com/v0.9.0/extension/view.json
https://cdn.staclint.com/v0.9.0/item.json

STAC Best Practices:
Item name 'LC81530252014153LGN00' should only contain Searchable identifiers
Identifiers should consist of only lowercase characters, numbers, '_', and '-'
https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers

Item file names should match their ids: 'landsat8-sample' not equal to 'LC81530252014153LGN00
</pre>

A link to 'self' in links is strongly recommended

### Asset Validation

This object has 4 links
</pre>

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

<pre>
<b>stac-check: STAC spec validation and linting tool</b>
Expand Down Expand Up @@ -176,7 +216,11 @@ ASSET request errors:
This object has 4 links
</pre>

` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets`
### Link and Asset Validation

```bash
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>
Expand Down Expand Up @@ -219,7 +263,11 @@ LINK request errors:
This object has 4 links
</pre>

` stac-check sample_files/0.9.0/bad-item.json`
### Invalid STAC

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

<pre>
<b>stac-check: STAC spec validation and linting tool</b>
Expand All @@ -244,7 +292,11 @@ 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`
### Using HTTP Headers

```bash
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>
Expand All @@ -269,8 +321,50 @@ No ASSET format errors!
This object has 4 links
</pre>

---
## Development

Create local docs in the /docs folder:

```bash
$ pdoc --output-dir pdoc ./stac_check
```

## Sponsors and Supporters

The following organizations have contributed time and/or funding to support the development of this project:
- [Healy Hyperspatial](https://healy-hyperspatial.github.io/)
- [Radiant Earth Foundation](https://radiant.earth/)

<p align="left">
<a href="https://healy-hyperspatial.github.io/"><img src="https://raw.githubusercontent.com/stac-utils/stac-fastapi-elasticsearch-opensearch/refs/heads/main/assets/hh-logo-blue.png" alt="Healy Hyperspatial" height="100" hspace="20"></a>
<a href="https://radiant.earth/"><img src="assets/radiant-earth.webp" alt="Radiant Earth Foundation" height="100" hspace="20"></a>
</p>

We are grateful for the support of our sponsors who help make this project possible. If your organization uses stac-check and would like to become a sponsor, please reach out to us!

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### How to Contribute

1. **Fork the repository** - Create your own fork of the project
2. **Create a feature branch** - `git checkout -b feature/your-feature-name`
3. **Commit your changes** - Make sure to write clear, concise commit messages
4. **Push to your branch** - `git push origin feature/your-feature-name`
5. **Open a Pull Request** - Describe your changes in detail

### Development Guidelines

- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Make sure all tests pass before submitting a PR

### Reporting Issues

If you find a bug or have a feature request, please open an issue on the [GitHub repository](https://github.com/stac-utils/stac-check/issues).

### Create local docs in the /docs folder
## License

`$ pdoc --output-dir pdoc ./stac_check`
This project is licensed under the Apache License 2.0.
Binary file added assets/radiant-earth.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/stac-check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.