diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4cfc8dd..e17d83a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6d47a..7084d5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 6f560c2..215d7f6 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,72 @@ # stac-check + + +

+ +

+ +[![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 @@ -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('') + +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('') +
stac-check: STAC spec validation and linting tool
 
-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
+
-`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 +
stac-check: STAC spec validation and linting tool
 
 Please upgrade from version 0.9.0 to version 1.1.0!
 
@@ -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`
-
-
stac-check: STAC spec validation and linting tool
-
-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
+
- A link to 'self' in links is strongly recommended +### Asset Validation -This object has 4 links -
- -` stac-check sample_files/1.0.0/core-item.json --assets` +```bash +stac-check sample_files/1.0.0/core-item.json --assets +```
 stac-check: STAC spec validation and linting tool
@@ -176,7 +216,11 @@ ASSET request errors:
 This object has 4 links
 
-` 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 +```
 stac-check: STAC spec validation and linting tool
@@ -219,7 +263,11 @@ LINK request errors:
 This object has 4 links
 
-` stac-check sample_files/0.9.0/bad-item.json` +### Invalid STAC + +```bash +stac-check sample_files/0.9.0/bad-item.json +```
 stac-check: STAC spec validation and linting tool
@@ -244,7 +292,11 @@ Validation error message:
 This object has 5 links
 
-` 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 +```
 stac-check: STAC spec validation and linting tool
@@ -269,8 +321,50 @@ No ASSET format errors!
 This object has 4 links
 
---- +## 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/) + +

+ Healy Hyperspatial + Radiant Earth Foundation +

+ +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. \ No newline at end of file diff --git a/assets/radiant-earth.webp b/assets/radiant-earth.webp new file mode 100644 index 0000000..441b569 Binary files /dev/null and b/assets/radiant-earth.webp differ diff --git a/assets/stac-check.png b/assets/stac-check.png new file mode 100644 index 0000000..e776d0c Binary files /dev/null and b/assets/stac-check.png differ