stac-validator 3.3.1__tar.gz → 3.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. stac_validator-3.4.0/PKG-INFO +356 -0
  2. {stac_validator-3.3.1 → stac_validator-3.4.0}/README.md +20 -14
  3. {stac_validator-3.3.1 → stac_validator-3.4.0}/setup.py +12 -12
  4. stac_validator-3.4.0/stac_validator/stac_validator.py +208 -0
  5. stac_validator-3.4.0/stac_validator/utilities.py +182 -0
  6. stac_validator-3.4.0/stac_validator/validate.py +544 -0
  7. stac_validator-3.4.0/stac_validator.egg-info/PKG-INFO +356 -0
  8. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator.egg-info/SOURCES.txt +12 -1
  9. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator.egg-info/entry_points.txt +0 -1
  10. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator.egg-info/requires.txt +3 -0
  11. stac_validator-3.4.0/tests/test_assets.py +85 -0
  12. stac_validator-3.4.0/tests/test_core.py +212 -0
  13. stac_validator-3.4.0/tests/test_custom.py +207 -0
  14. stac_validator-3.4.0/tests/test_default.py +160 -0
  15. stac_validator-3.4.0/tests/test_extensions.py +215 -0
  16. stac_validator-3.4.0/tests/test_links.py +80 -0
  17. stac_validator-3.4.0/tests/test_recursion.py +355 -0
  18. stac_validator-3.4.0/tests/test_sys_exit.py +32 -0
  19. stac_validator-3.4.0/tests/test_validate_collections.py +55 -0
  20. stac_validator-3.4.0/tests/test_validate_dict.py +67 -0
  21. stac_validator-3.4.0/tests/test_validate_item_collection.py +663 -0
  22. stac_validator-3.3.1/PKG-INFO +0 -344
  23. stac_validator-3.3.1/stac_validator/stac_validator.py +0 -138
  24. stac_validator-3.3.1/stac_validator/utilities.py +0 -92
  25. stac_validator-3.3.1/stac_validator/validate.py +0 -376
  26. stac_validator-3.3.1/stac_validator.egg-info/PKG-INFO +0 -344
  27. {stac_validator-3.3.1 → stac_validator-3.4.0}/LICENSE +0 -0
  28. {stac_validator-3.3.1 → stac_validator-3.4.0}/pyproject.toml +0 -0
  29. {stac_validator-3.3.1 → stac_validator-3.4.0}/setup.cfg +0 -0
  30. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator/__init__.py +0 -0
  31. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator.egg-info/dependency_links.txt +0 -0
  32. {stac_validator-3.3.1 → stac_validator-3.4.0}/stac_validator.egg-info/top_level.txt +0 -0
@@ -0,0 +1,356 @@
1
+ Metadata-Version: 2.1
2
+ Name: stac_validator
3
+ Version: 3.4.0
4
+ Summary: A package to validate STAC files
5
+ Home-page: https://github.com/stac-utils/stac-validator
6
+ Author: James Banting, Jonathan Healy
7
+ Author-email: jonathan.d.healy@gmail.com
8
+ License: Apache-2.0
9
+ Keywords: STAC validation raster
10
+ Classifier: Intended Audience :: Information Technology
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Topic :: Scientific/Engineering :: GIS
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: requests>=2.19.1
19
+ Requires-Dist: jsonschema>=3.2.0
20
+ Requires-Dist: click>=8.0.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: types-setuptools; extra == "dev"
24
+
25
+ # SpatioTemporal Asset Catalog (STAC) Validator
26
+
27
+ ## Documentation
28
+
29
+ [read the docs](https://stac-validator.readthedocs.io/en/latest/)
30
+
31
+ ## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).
32
+
33
+ ```bash
34
+ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json
35
+ [
36
+ {
37
+ "version": "1.0.0",
38
+ "path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
39
+ "schema": [
40
+ "https://stac-extensions.github.io/eo/v1.0.0/schema.json",
41
+ "https://stac-extensions.github.io/projection/v1.0.0/schema.json",
42
+ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
43
+ "https://stac-extensions.github.io/view/v1.0.0/schema.json",
44
+ "https://stac-extensions.github.io/remote-data/v1.0.0/schema.json",
45
+ "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
46
+ ],
47
+ "valid_stac": true,
48
+ "asset_type": "ITEM",
49
+ "validation_method": "default"
50
+ }
51
+ ]
52
+ ```
53
+
54
+ ## Requirements
55
+
56
+ - Python 3.8+
57
+ - Requests
58
+ - Click
59
+ - Jsonschema
60
+
61
+ Note: Stac-validator is also used in stac-check which adds linting messages based on the official STAC best practices document.
62
+ https://github.com/stac-utils/stac-check
63
+
64
+ ## Install
65
+
66
+ Installation from PyPi
67
+
68
+ ```bash
69
+ pip install stac-validator
70
+ ```
71
+
72
+ Installation from Repo
73
+
74
+ ```bash
75
+ pip install .
76
+ ```
77
+
78
+ or for local development
79
+
80
+ ```bash
81
+ pip install -e '.[dev]'
82
+ ```
83
+
84
+ The [Makefile](./Makefile) has convenience commands if Make is installed.
85
+
86
+ ```bash
87
+ make help
88
+ ```
89
+
90
+ ## Versions supported
91
+
92
+ | STAC |
93
+ | ------------ |
94
+ | 0.8.0 |
95
+ | 0.8.1 |
96
+ | 0.9.0 |
97
+ | 1.0.0-beta.1 |
98
+ | 1.0.0-beta.2 |
99
+ | 1.0.0-rc.1 |
100
+ | 1.0.0-rc.2 |
101
+ | 1.0.0-rc.3 |
102
+ | 1.0.0-rc.4 |
103
+ | 1.0.0 |
104
+ | 1.1.0-beta.1 |
105
+ | 1.1.0 |
106
+
107
+ ---
108
+
109
+ # CLI
110
+
111
+ **Basic Usage**
112
+
113
+ ```bash
114
+ stac-validator --help
115
+ Usage: stac-validator [OPTIONS] STAC_FILE
116
+
117
+ Options:
118
+ --core Validate core stac object only without extensions.
119
+ --extensions Validate extensions only.
120
+ --links Additionally validate links. Only works with
121
+ default mode.
122
+ --assets Additionally validate assets. Only works with
123
+ default mode.
124
+ -c, --custom TEXT Validate against a custom schema (local filepath or
125
+ remote schema).
126
+ -r, --recursive Recursively validate all related stac objects.
127
+ -m, --max-depth INTEGER Maximum depth to traverse when recursing. Omit this
128
+ argument to get full recursion. Ignored if
129
+ `recursive == False`.
130
+ --collections Validate /collections response.
131
+ --item-collection Validate item collection response. Can be combined
132
+ with --pages. Defaults to one page.
133
+ -p, --pages INTEGER Maximum number of pages to validate via --item-
134
+ collection. Defaults to one page.
135
+ -v, --verbose Enables verbose output for recursive mode.
136
+ --no_output Do not print output to console.
137
+ --log_file TEXT Save full recursive output to log file (local
138
+ filepath).
139
+ --version Show the version and exit.
140
+ --help Show this message and exit.
141
+ ```
142
+
143
+ ---
144
+
145
+ # Deployment
146
+
147
+ ## Docker
148
+
149
+ The validator can run using docker containers.
150
+
151
+ ```bash
152
+ docker build -t stac-validator .
153
+ docker run stac-validator https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json
154
+ [
155
+ {
156
+ "version": "1.0.0",
157
+ "path": "https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json",
158
+ "schema": [
159
+ "https://stac-extensions.github.io/projection/v1.0.0/schema.json",
160
+ "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
161
+ ],
162
+ "valid_stac": true,
163
+ "asset_type": "ITEM",
164
+ "validation_method": "default"
165
+ }
166
+ ]
167
+ ```
168
+
169
+ ## AWS (CDK)
170
+
171
+ An example [AWS CDK](https://aws.amazon.com/cdk/) deployment is available in [cdk-deployment](./cdk-deployment/README.md)
172
+
173
+ ```bash
174
+ cd cdk-deployment
175
+ cdk diff
176
+ ```
177
+
178
+ ---
179
+
180
+ # Python
181
+
182
+ **Remote source**
183
+
184
+ ```python
185
+ from stac_validator import stac_validator
186
+
187
+ stac = stac_validator.StacValidate("https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json")
188
+ stac.run()
189
+ print(stac.message)
190
+ [
191
+ {
192
+ "version": "0.9.0",
193
+ "path": "https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json",
194
+ "schema": [
195
+ "https://cdn.staclint.com/v0.9.0/collection.json"
196
+ ],
197
+ "valid_stac": true,
198
+ "asset_type": "COLLECTION",
199
+ "validation_method": "default"
200
+ }
201
+ ]
202
+ ```
203
+
204
+ **Local file**
205
+
206
+ ```python
207
+ from stac_validator import stac_validator
208
+
209
+ stac = stac_validator.StacValidate("tests/test_data/1beta1/sentinel2.json", extensions=True)
210
+ stac.run()
211
+ print(stac.message)
212
+ [
213
+ {
214
+ "version": "1.0.0-beta.1",
215
+ "path": "tests/test_data/1beta1/sentinel2.json",
216
+ "schema": [
217
+ "https://cdn.staclint.com/v1.0.0-beta.1/collection.json"
218
+ ],
219
+ "valid_stac": true,
220
+ "asset_type": "COLLECTION",
221
+ "validation_method": "extensions"
222
+ }
223
+ ]
224
+ ```
225
+
226
+ **Dictionary**
227
+
228
+ ```python
229
+ from stac_validator import stac_validator
230
+
231
+ stac = stac_validator.StacValidate()
232
+ stac.validate_dict(dictionary)
233
+ print(stac.message)
234
+ ```
235
+
236
+ **Item Collection**
237
+
238
+ ```python
239
+ from stac_validator import stac_validator
240
+
241
+ stac = stac_validator.StacValidate()
242
+ stac.validate_item_collection_dict(item_collection_dict)
243
+ print(stac.message)
244
+ ```
245
+
246
+ ---
247
+
248
+ # Testing
249
+
250
+ ```bash
251
+ make test
252
+ # or
253
+ pytest -v
254
+ ```
255
+
256
+ See the [tests](./tests/test_stac_validator.py) files for examples on different usages.
257
+
258
+ ---
259
+
260
+ # Additional Examples
261
+
262
+ **--core**
263
+
264
+ ```bash
265
+ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --core
266
+ [
267
+ {
268
+ "version": "1.0.0",
269
+ "path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
270
+ "schema": [
271
+ "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
272
+ ],
273
+ "valid_stac": true,
274
+ "asset_type": "ITEM",
275
+ "validation_method": "core"
276
+ }
277
+ ]
278
+ ```
279
+
280
+ **--custom**
281
+
282
+ ```bash
283
+ stac-validator https://radarstac.s3.amazonaws.com/stac/catalog.json --custom https://cdn.staclint.com/v0.7.0/catalog.json
284
+ [
285
+ {
286
+ "version": "0.7.0",
287
+ "path": "https://radarstac.s3.amazonaws.com/stac/catalog.json",
288
+ "schema": [
289
+ "https://cdn.staclint.com/v0.7.0/catalog.json"
290
+ ],
291
+ "asset_type": "CATALOG",
292
+ "validation_method": "custom",
293
+ "valid_stac": true
294
+ }
295
+ ]
296
+ ```
297
+
298
+ **--extensions**
299
+
300
+ ```bash
301
+ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --extensions
302
+ [
303
+ {
304
+ "version": "1.0.0",
305
+ "path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
306
+ "schema": [
307
+ "https://stac-extensions.github.io/eo/v1.0.0/schema.json",
308
+ "https://stac-extensions.github.io/projection/v1.0.0/schema.json",
309
+ "https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
310
+ "https://stac-extensions.github.io/view/v1.0.0/schema.json",
311
+ "https://stac-extensions.github.io/remote-data/v1.0.0/schema.json"
312
+ ],
313
+ "valid_stac": true,
314
+ "asset_type": "ITEM",
315
+ "validation_method": "extensions"
316
+ }
317
+ ]
318
+ ```
319
+
320
+ **--recursive**
321
+
322
+ ```bash
323
+ stac-validator https://spot-canada-ortho.s3.amazonaws.com/catalog.json --recursive --max-depth 1 --verbose
324
+ [
325
+ {
326
+ "version": "0.8.1",
327
+ "path": "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot4_orthoimages/collection.json",
328
+ "schema": "https://cdn.staclint.com/v0.8.1/collection.json",
329
+ "asset_type": "COLLECTION",
330
+ "validation_method": "recursive",
331
+ "valid_stac": true
332
+ },
333
+ {
334
+ "version": "0.8.1",
335
+ "path": "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/collection.json",
336
+ "schema": "https://cdn.staclint.com/v0.8.1/collection.json",
337
+ "asset_type": "COLLECTION",
338
+ "validation_method": "recursive",
339
+ "valid_stac": true
340
+ },
341
+ {
342
+ "version": "0.8.1",
343
+ "path": "https://spot-canada-ortho.s3.amazonaws.com/catalog.json",
344
+ "schema": "https://cdn.staclint.com/v0.8.1/catalog.json",
345
+ "asset_type": "CATALOG",
346
+ "validation_method": "recursive",
347
+ "valid_stac": true
348
+ }
349
+ ]
350
+ ```
351
+
352
+ **--item-collection**
353
+
354
+ ```bash
355
+ stac-validator https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a/items --item-collection --pages 2
356
+ ```
@@ -1,9 +1,10 @@
1
1
  # SpatioTemporal Asset Catalog (STAC) Validator
2
2
 
3
+ ## Documentation
3
4
 
4
- ## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).
5
-
5
+ [read the docs](https://stac-validator.readthedocs.io/en/latest/)
6
6
 
7
+ ## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).
7
8
 
8
9
  ```bash
9
10
  stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json
@@ -28,10 +29,9 @@ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/e
28
29
 
29
30
  ## Requirements
30
31
 
31
- - Python 3.7+
32
+ - Python 3.8+
32
33
  - Requests
33
34
  - Click
34
- - Pytest
35
35
  - Jsonschema
36
36
 
37
37
  Note: Stac-validator is also used in stac-check which adds linting messages based on the official STAC best practices document.
@@ -51,10 +51,10 @@ Installation from Repo
51
51
  pip install .
52
52
  ```
53
53
 
54
- or (for development)
54
+ or for local development
55
55
 
56
56
  ```bash
57
- pip install --editable .["test"]
57
+ pip install -e '.[dev]'
58
58
  ```
59
59
 
60
60
  The [Makefile](./Makefile) has convenience commands if Make is installed.
@@ -77,7 +77,8 @@ make help
77
77
  | 1.0.0-rc.3 |
78
78
  | 1.0.0-rc.4 |
79
79
  | 1.0.0 |
80
-
80
+ | 1.1.0-beta.1 |
81
+ | 1.1.0 |
81
82
 
82
83
  ---
83
84
 
@@ -102,6 +103,7 @@ Options:
102
103
  -m, --max-depth INTEGER Maximum depth to traverse when recursing. Omit this
103
104
  argument to get full recursion. Ignored if
104
105
  `recursive == False`.
106
+ --collections Validate /collections response.
105
107
  --item-collection Validate item collection response. Can be combined
106
108
  with --pages. Defaults to one page.
107
109
  -p, --pages INTEGER Maximum number of pages to validate via --item-
@@ -141,7 +143,9 @@ docker run stac-validator https://raw.githubusercontent.com/stac-extensions/proj
141
143
  ```
142
144
 
143
145
  ## AWS (CDK)
146
+
144
147
  An example [AWS CDK](https://aws.amazon.com/cdk/) deployment is available in [cdk-deployment](./cdk-deployment/README.md)
148
+
145
149
  ```bash
146
150
  cd cdk-deployment
147
151
  cdk diff
@@ -196,29 +200,29 @@ print(stac.message)
196
200
  ```
197
201
 
198
202
  **Dictionary**
199
-
203
+
200
204
  ```python
201
205
  from stac_validator import stac_validator
202
-
206
+
203
207
  stac = stac_validator.StacValidate()
204
208
  stac.validate_dict(dictionary)
205
209
  print(stac.message)
206
210
  ```
207
211
 
208
212
  **Item Collection**
209
-
213
+
210
214
  ```python
211
215
  from stac_validator import stac_validator
212
-
216
+
213
217
  stac = stac_validator.StacValidate()
214
218
  stac.validate_item_collection_dict(item_collection_dict)
215
219
  print(stac.message)
216
220
  ```
221
+
217
222
  ---
218
223
 
219
224
  # Testing
220
225
 
221
-
222
226
  ```bash
223
227
  make test
224
228
  # or
@@ -228,6 +232,7 @@ pytest -v
228
232
  See the [tests](./tests/test_stac_validator.py) files for examples on different usages.
229
233
 
230
234
  ---
235
+
231
236
  # Additional Examples
232
237
 
233
238
  **--core**
@@ -287,7 +292,7 @@ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/e
287
292
  }
288
293
  ]
289
294
  ```
290
-
295
+
291
296
  **--recursive**
292
297
 
293
298
  ```bash
@@ -319,8 +324,9 @@ stac-validator https://spot-canada-ortho.s3.amazonaws.com/catalog.json --recursi
319
324
  }
320
325
  ]
321
326
  ```
327
+
322
328
  **--item-collection**
323
329
 
324
330
  ```bash
325
331
  stac-validator https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a/items --item-collection --pages 2
326
- ```
332
+ ```
@@ -2,44 +2,44 @@
2
2
 
3
3
  from setuptools import setup
4
4
 
5
- __version__ = "3.3.1"
5
+ __version__ = "3.4.0"
6
6
 
7
7
  with open("README.md", "r") as fh:
8
8
  long_description = fh.read()
9
9
 
10
- extra_reqs = {
11
- "test": ["pytest"],
12
- }
13
-
14
10
  setup(
15
11
  name="stac_validator",
16
12
  version=__version__,
17
13
  author="James Banting, Jonathan Healy",
18
- author_email="jhealy@sparkgeo.com",
14
+ author_email="jonathan.d.healy@gmail.com",
19
15
  description="A package to validate STAC files",
20
- license="MIT",
16
+ license="Apache-2.0",
21
17
  classifiers=[
22
18
  "Intended Audience :: Information Technology",
23
19
  "Intended Audience :: Science/Research",
24
- "License :: OSI Approved :: MIT License",
25
- "Programming Language :: Python :: 3.7",
20
+ "License :: OSI Approved :: Apache Software License",
21
+ "Programming Language :: Python :: 3.8",
26
22
  "Topic :: Scientific/Engineering :: GIS",
27
23
  ],
28
24
  keywords="STAC validation raster",
29
25
  long_description=long_description,
30
26
  long_description_content_type="text/markdown",
31
27
  url="https://github.com/stac-utils/stac-validator",
32
- download_url="https://github.com/stac-utils/stac-validator/archive/v2.5.0.tar.gz",
33
28
  install_requires=[
34
29
  "requests>=2.19.1",
35
30
  "jsonschema>=3.2.0",
36
31
  "click>=8.0.0",
37
- "types-setuptools",
38
32
  ],
33
+ extras_require={
34
+ "dev": [
35
+ "pytest",
36
+ "types-setuptools",
37
+ ],
38
+ },
39
39
  packages=["stac_validator"],
40
40
  entry_points={
41
41
  "console_scripts": ["stac-validator = stac_validator.stac_validator:main"]
42
42
  },
43
- python_requires=">=3.7",
43
+ python_requires=">=3.8",
44
44
  tests_require=["pytest"],
45
45
  )