1
1
# stac-check
2
+
2
3
## A linting and validation tool for STAC assets
3
4
4
5
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 )
5
6
6
7
---
8
+
7
9
### Documentation
10
+
8
11
[ stac-check.readthedocs.io] ( https://stac-check.readthedocs.io/en/latest/ )
9
12
10
13
---
14
+
11
15
### Install
16
+
12
17
` $ pip install stac-check `
13
18
14
19
or for local development
15
20
16
21
` $ pip install -e '.[dev]' `
17
22
18
23
---
24
+
19
25
### CLI Usage
26
+
20
27
```
21
28
Usage: stac-check [OPTIONS] FILE
22
29
@@ -34,14 +41,18 @@ Options:
34
41
multiple times.
35
42
--help Show this message and exit. Show this message and exit.
36
43
```
44
+
37
45
---
46
+
38
47
### Docker
39
48
40
49
```
41
50
$ make build
42
51
$ make shell
43
52
```
53
+
44
54
---
55
+
45
56
### Lint JSON
46
57
47
58
```
@@ -52,10 +63,13 @@ linter = Linter('<json_path>')
52
63
for k, v in linter.create_best_practices_dict().items():
53
64
print(k, ":", v)
54
65
```
66
+
55
67
---
68
+
56
69
### CLI Examples
57
70
58
- ``` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ```
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 `
72
+
59
73
```
60
74
____ ____ __ ___ ___ _ _ ____ ___ __ _
61
75
/ ___)(_ _)/ _\ / __)___ / __)/ )( \( __)/ __)( / )
@@ -64,7 +78,7 @@ for k, v in linter.create_best_practices_dict().items():
64
78
65
79
stac-check: STAC spec validation and linting tool
66
80
67
- Please upgrade from version 0.9.0 to version 1.0 .0!
81
+ Please upgrade from version 0.9.0 to version 1.1 .0!
68
82
69
83
Validator: stac-validator 3.5.0
70
84
@@ -100,11 +114,11 @@ Error Message: Expecting value: line 1 column 1 (char 0)
100
114
-------------------------
101
115
```
102
116
103
- ``` stac-check sample_files/0.9.0/landsat8-sample.json `` `
117
+ ` stac-check sample_files/0.9.0/landsat8-sample.json `
104
118
105
119
<pre ><b >stac-check: STAC spec validation and linting tool</b >
106
120
107
- Please upgrade from version 0.9.0 to version 1.0 .0!
121
+ Please upgrade from version 0.9.0 to version 1.1 .0!
108
122
109
123
Validator: stac-validator 3.5.0
110
124
@@ -128,11 +142,12 @@ STAC Best Practices:
128
142
This object has 4 links
129
143
</pre >
130
144
131
- ``` stac-check sample_files/1.0.0/core-item.json --assets ```
145
+ ` stac-check sample_files/1.0.0/core-item.json --assets `
146
+
132
147
<pre >
133
148
<b >stac-check: STAC spec validation and linting tool</b >
134
149
135
- Thanks for using STAC version 1.0.0!
150
+ Please upgrade from version 1.0.0 to version 1.1 .0!
136
151
137
152
Validator: stac-validator 3.5.0
138
153
@@ -161,13 +176,12 @@ ASSET request errors:
161
176
This object has 4 links
162
177
</pre >
163
178
179
+ ` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets `
164
180
165
-
166
- ``` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets ```
167
181
<pre >
168
182
<b >stac-check: STAC spec validation and linting tool</b >
169
183
170
- Thanks for using STAC version 1.0.0!
184
+ Please upgrade from version 1.0.0 to version 1.1 .0!
171
185
172
186
Validator: stac-validator 3.5.0
173
187
@@ -205,11 +219,12 @@ LINK request errors:
205
219
This object has 4 links
206
220
</pre >
207
221
208
- ``` stac-check sample_files/0.9.0/bad-item.json ```
222
+ ` stac-check sample_files/0.9.0/bad-item.json `
223
+
209
224
<pre >
210
225
<b >stac-check: STAC spec validation and linting tool</b >
211
226
212
- Please upgrade from version 0.9.0 to version 1.0 .0!
227
+ Please upgrade from version 0.9.0 to version 1.1 .0!
213
228
214
229
Validator: stac-validator 3.5.0
215
230
@@ -229,11 +244,12 @@ Validation error message:
229
244
This object has 5 links
230
245
</pre >
231
246
232
- ``` 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 ```
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 `
248
+
233
249
<pre >
234
250
<b >stac-check: STAC spec validation and linting tool</b >
235
251
236
- Thanks for using STAC version 1.0.0!
252
+ Please upgrade from version 1.0.0 to version 1.1 .0!
237
253
238
254
Validator: stac-validator 3.5.0
239
255
@@ -252,6 +268,9 @@ No ASSET format errors!
252
268
253
269
This object has 4 links
254
270
</pre >
271
+
255
272
---
273
+
256
274
### Create local docs in the /docs folder
275
+
257
276
` $ pdoc --output-dir pdoc ./stac_check `
0 commit comments