1
1
# stac-check
2
2
3
+ <!-- markdownlint-disable MD033 MD041 -->
4
+
5
+ <p align =" left " >
6
+ <img src =" assets/stac-check.png " width =560 >
7
+ </p >
8
+
9
+ [ ![ Downloads] ( https://static.pepy.tech/badge/stac-check?color=blue )] ( https://pepy.tech/project/stac-check )
10
+ [ ![ GitHub contributors] ( https://img.shields.io/github/contributors/stac-utils/stac-check?color=blue )] ( https://github.com/stac-utils/stac-check/graphs/contributors )
11
+ [ ![ GitHub stars] ( https://img.shields.io/github/stars/stac-utils/stac-check.svg?color=blue )] ( https://github.com/stac-utils/stac-check/stargazers )
12
+ [ ![ GitHub forks] ( https://img.shields.io/github/forks/stac-utils/stac-check.svg?color=blue )] ( https://github.com/stac-utils/stac-check/network/members )
13
+ [ ![ PyPI version] ( https://img.shields.io/pypi/v/stac-check.svg?color=blue )] ( https://pypi.org/project/stac-check/ )
14
+ [ ![ STAC] ( https://img.shields.io/badge/STAC-1.1.0-blue.svg )] ( https://github.com/radiantearth/stac-spec/tree/v1.1.0 )
15
+
3
16
## A linting and validation tool for STAC assets
4
17
5
18
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 )
6
19
7
- ---
8
-
9
- ### Documentation
20
+ ## Table of Contents
21
+
22
+ - [ Documentation] ( #documentation )
23
+ - [ Installation] ( #installation )
24
+ - [ Pip] ( #pip )
25
+ - [ Docker] ( #docker )
26
+ - [ Usage] ( #usage )
27
+ - [ CLI Usage] ( #cli-usage )
28
+ - [ Python API Usage] ( #python-api-usage )
29
+ - [ Examples] ( #examples )
30
+ - [ Basic Validation] ( #basic-validation )
31
+ - [ Recursive Validation] ( #recursive-validation )
32
+ - [ Asset Validation] ( #asset-validation )
33
+ - [ Link and Asset Validation] ( #link-and-asset-validation )
34
+ - [ Invalid STAC] ( #invalid-stac )
35
+ - [ Using HTTP Headers] ( #using-http-headers )
36
+ - [ Development] ( #development )
37
+ - [ Sponsors and Supporters] ( #sponsors-and-supporters )
38
+ - [ Contributing] ( #contributing )
39
+ - [ How to Contribute] ( #how-to-contribute )
40
+ - [ Development Guidelines] ( #development-guidelines )
41
+ - [ Reporting Issues] ( #reporting-issues )
42
+ - [ License] ( #license )
43
+
44
+ ## Documentation
10
45
11
46
[ stac-check.readthedocs.io] ( https://stac-check.readthedocs.io/en/latest/ )
12
47
13
- ---
48
+ ## Installation
14
49
15
- ### Install
50
+ ### Pip
16
51
17
- ` $ pip install stac-check `
52
+ ``` bash
53
+ $ pip install stac-check
54
+ ```
18
55
19
- or for local development
56
+ For local development:
20
57
21
- ` $ pip install -e '.[dev]' `
58
+ ``` bash
59
+ $ pip install -e ' .[dev]'
60
+ ```
22
61
23
- ---
62
+ ### Docker
63
+
64
+ ``` bash
65
+ $ make build
66
+ $ make shell
67
+ ```
68
+
69
+ ## Usage
24
70
25
71
### CLI Usage
26
72
@@ -39,44 +85,61 @@ Options:
39
85
(enabled by default).
40
86
--header KEY VALUE HTTP header to include in the requests. Can be used
41
87
multiple times.
42
- --help Show this message and exit. Show this message and exit.
88
+ --help Show this message and exit.
43
89
```
44
90
45
- ---
91
+ ### Python API Usage
46
92
47
- ### Docker
93
+ ``` python
94
+ from stac_check.lint import Linter
48
95
49
- ```
50
- $ make build
51
- $ make shell
96
+ linter = Linter(' <json_path>' )
97
+
98
+ for k, v in linter.create_best_practices_dict().items():
99
+ print (k, " :" , v)
52
100
```
53
101
54
- ---
102
+ ## Examples
55
103
56
- ### Lint JSON
104
+ ### Basic Validation
57
105
106
+ ``` bash
107
+ stac-check sample_files/0.9.0/landsat8-sample.json
58
108
```
59
- from stac_check.lint import Linter
60
109
61
- linter = Linter('<json_path>')
110
+ < pre >< b >stac-check: STAC spec validation and linting tool</ b >
62
111
63
- for k, v in linter.create_best_practices_dict().items():
64
- print(k, ":", v)
65
- ```
112
+ Please upgrade from version 0.9.0 to version 1.1.0!
113
+
114
+ Validator: stac-validator 3.5.0
115
+
116
+ Valid ITEM: True
117
+
118
+ Schemas validated:
119
+ https://cdn.staclint.com/v0.9.0/extension/eo.json
120
+ https://cdn.staclint.com/v0.9.0/extension/view.json
121
+ https://cdn.staclint.com/v0.9.0/item.json
66
122
67
- ---
123
+ STAC Best Practices:
124
+ Item name 'LC81530252014153LGN00' should only contain Searchable identifiers
125
+ Identifiers should consist of only lowercase characters, numbers, '_', and '-'
126
+ https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers
127
+
128
+ Item file names should match their ids: 'landsat8-sample' not equal to 'LC81530252014153LGN00
68
129
69
- ### CLI Examples
130
+ A link to 'self' in links is strongly recommended
131
+
132
+
133
+ This object has 4 links
134
+ </pre >
70
135
71
- ` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive `
136
+ ### Recursive Validation
72
137
138
+ ``` bash
139
+ stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive
73
140
```
74
- ____ ____ __ ___ ___ _ _ ____ ___ __ _
75
- / ___)(_ _)/ _\ / __)___ / __)/ )( \( __)/ __)( / )
76
- \___ \ )( / \( (__(___)( (__ ) __ ( ) _)( (__ ) (
77
- (____/ (__)\_/\_/ \___) \___)\_)(_/(____)\___)(__\_)
78
141
79
- stac-check: STAC spec validation and linting tool
142
+ < pre >< b > stac-check: STAC spec validation and linting tool</ b >
80
143
81
144
Please upgrade from version 0.9.0 to version 1.1.0!
82
145
@@ -112,37 +175,14 @@ Schemas validated:
112
175
Error Type: JSONDecodeError
113
176
Error Message: Expecting value: line 1 column 1 (char 0)
114
177
-------------------------
115
- ```
116
-
117
- ` stac-check sample_files/0.9.0/landsat8-sample.json `
118
-
119
- <pre ><b >stac-check: STAC spec validation and linting tool</b >
120
-
121
- Please upgrade from version 0.9.0 to version 1.1.0!
122
-
123
- Validator: stac-validator 3.5.0
124
-
125
- Valid ITEM: True
126
-
127
- Schemas validated:
128
- https://cdn.staclint.com/v0.9.0/extension/eo.json
129
- https://cdn.staclint.com/v0.9.0/extension/view.json
130
- https://cdn.staclint.com/v0.9.0/item.json
131
-
132
- STAC Best Practices:
133
- Item name 'LC81530252014153LGN00' should only contain Searchable identifiers
134
- Identifiers should consist of only lowercase characters, numbers, '_', and '-'
135
- https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers
136
-
137
- Item file names should match their ids: 'landsat8-sample' not equal to 'LC81530252014153LGN00
178
+ </pre >
138
179
139
- A link to 'self' in links is strongly recommended
140
180
181
+ ### Asset Validation
141
182
142
- This object has 4 links
143
- </pre >
144
-
145
- ` stac-check sample_files/1.0.0/core-item.json --assets `
183
+ ``` bash
184
+ stac-check sample_files/1.0.0/core-item.json --assets
185
+ ```
146
186
147
187
<pre >
148
188
<b >stac-check: STAC spec validation and linting tool</b >
@@ -176,7 +216,11 @@ ASSET request errors:
176
216
This object has 4 links
177
217
</pre >
178
218
179
- ` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets `
219
+ ### Link and Asset Validation
220
+
221
+ ``` bash
222
+ stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets
223
+ ```
180
224
181
225
<pre >
182
226
<b >stac-check: STAC spec validation and linting tool</b >
@@ -219,7 +263,11 @@ LINK request errors:
219
263
This object has 4 links
220
264
</pre >
221
265
222
- ` stac-check sample_files/0.9.0/bad-item.json `
266
+ ### Invalid STAC
267
+
268
+ ``` bash
269
+ stac-check sample_files/0.9.0/bad-item.json
270
+ ```
223
271
224
272
<pre >
225
273
<b >stac-check: STAC spec validation and linting tool</b >
@@ -244,7 +292,11 @@ Validation error message:
244
292
This object has 5 links
245
293
</pre >
246
294
247
- ` 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 `
295
+ ### Using HTTP Headers
296
+
297
+ ``` bash
298
+ 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
299
+ ```
248
300
249
301
<pre >
250
302
<b >stac-check: STAC spec validation and linting tool</b >
@@ -269,8 +321,50 @@ No ASSET format errors!
269
321
This object has 4 links
270
322
</pre >
271
323
272
- ---
324
+ ## Development
325
+
326
+ Create local docs in the /docs folder:
327
+
328
+ ``` bash
329
+ $ pdoc --output-dir pdoc ./stac_check
330
+ ```
331
+
332
+ ## Sponsors and Supporters
333
+
334
+ The following organizations have contributed time and/or funding to support the development of this project:
335
+ - [ Healy Hyperspatial] ( https://healy-hyperspatial.github.io/ )
336
+ - [ Radiant Earth Foundation] ( https://radiant.earth/ )
337
+
338
+ <p align =" left " >
339
+ <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 >
340
+ <a href =" https://radiant.earth/ " ><img src =" assets/radiant-earth.webp " alt =" Radiant Earth Foundation " height =" 100 " hspace =" 20 " ></a >
341
+ </p >
342
+
343
+ 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!
344
+
345
+ ## Contributing
346
+
347
+ Contributions are welcome! Please feel free to submit a Pull Request.
348
+
349
+ ### How to Contribute
350
+
351
+ 1 . ** Fork the repository** - Create your own fork of the project
352
+ 2 . ** Create a feature branch** - ` git checkout -b feature/your-feature-name `
353
+ 3 . ** Commit your changes** - Make sure to write clear, concise commit messages
354
+ 4 . ** Push to your branch** - ` git push origin feature/your-feature-name `
355
+ 5 . ** Open a Pull Request** - Describe your changes in detail
356
+
357
+ ### Development Guidelines
358
+
359
+ - Follow the existing code style
360
+ - Add tests for new features
361
+ - Update documentation as needed
362
+ - Make sure all tests pass before submitting a PR
363
+
364
+ ### Reporting Issues
365
+
366
+ 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 ) .
273
367
274
- ### Create local docs in the /docs folder
368
+ ## License
275
369
276
- ` $ pdoc --output-dir pdoc ./stac_check `
370
+ This project is licensed under the Apache License 2.0.
0 commit comments