Skip to content

Commit a7e6441

Browse files
authored
Merge pull request #150 from jonhealy1/add-fast-mode
Add --fast mode via fastjsonschema
2 parents 1304a1b + 2baeba9 commit a7e6441

11 files changed

Lines changed: 63086 additions & 90 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
66

77
## Unreleased
88

9+
## [v1.13.0] - 2026-04-29
10+
11+
### Added
12+
13+
- Support for FastJSONSchema validation method with --fast flag to validate items, item collections ([#150](https://github.com/stac-utils/stac-check/pull/150))
14+
915
### Updated
1016

1117
- Updated publish script to use pyproject.toml instead of setup.py ([#149](https://github.com/stac-utils/stac-check/pull/149))
@@ -322,7 +328,8 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
322328
- Validation from stac-validator 2.3.0
323329
- Links and assets validation checks
324330

325-
[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.12.0...main
331+
[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.13.0...main
332+
[v1.13.0]: https://github.com/stac-utils/stac-check/compare/v1.12.0...v1.13.0
326333
[v1.12.0]: https://github.com/stac-utils/stac-check/compare/v1.11.1...v1.12.0
327334
[v1.11.1]: https://github.com/stac-utils/stac-check/compare/v1.11.0...v1.11.1
328335
[v1.11.0]: https://github.com/stac-utils/stac-check/compare/v1.10.1...v1.11.0

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The intent of this project is to provide a validation tool that also follows the
3535
- [Link and Asset Validation](#link-and-asset-validation)
3636
- [Invalid STAC](#invalid-stac)
3737
- [Using HTTP Headers](#using-http-headers)
38+
- [Fast Validation](#fast-validation)
3839
- [STAC API Validation](#stac-api-validation)
3940
- [Development](#development)
4041
- [Building Documentation](#building-documentation)
@@ -94,6 +95,8 @@ Options:
9495
--pydantic Use stac-pydantic for enhanced validation with Pydantic models.
9596
--verbose Show verbose error messages.
9697
-o, --output FILE Save output to the specified file.
98+
--fast Use FastJSONSchema for high-speed validation. Skips best
99+
practices and geometry checks for maximum performance.
97100
--item-collection Validate item collection response. Can be combined with
98101
--pages. Defaults to one page.
99102
--collections Validate collections endpoint response. Can be combined with
@@ -421,6 +424,64 @@ No ASSET format errors!
421424
This object has 4 links
422425
</pre>
423426

427+
### Fast Validation
428+
429+
For large STAC collections or when you need maximum validation speed, use the `--fast` flag to enable FastJSONSchema validation. This mode skips best practices and geometry checks, focusing only on STAC spec compliance.
430+
431+
**Fast Validation of a Large Item Collection:**
432+
433+
```bash
434+
stac-check large_collection.json --fast
435+
```
436+
437+
<pre><b>stac-check: STAC spec validation and linting tool</b>
438+
439+
Validator: stac-valid 4.2.1
440+
441+
Validation method: FastJSONSchema
442+
443+
Validation Summary
444+
445+
✅ Passed: 998/1000
446+
❌ Failed: 2/1000
447+
448+
⚡ Timing Information:
449+
Total Validation Time: 245.67 ms
450+
Average per Object: 0.246 ms
451+
452+
Schemas checked:
453+
https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json
454+
https://stac-extensions.github.io/eo/v1.0.0/schema.json
455+
https://stac-extensions.github.io/projection/v1.0.0/schema.json
456+
457+
Validation Errors
458+
459+
❌ STAC Spec Violation: Missing {'rel': 'collection'} in links array.
460+
Affected Items: 2 | Examples: item_1, item_2
461+
</pre>
462+
463+
**Fast Validation with Verbose Output:**
464+
465+
You can combine `--fast` with `--verbose` to see detailed validation output for each item:
466+
467+
```bash
468+
stac-check large_collection.json --fast --verbose
469+
```
470+
471+
This will show detailed validation information for each item while still maintaining the speed benefits of FastJSONSchema.
472+
473+
**Performance Comparison:**
474+
475+
- **`--fast` mode**: ~0.25ms per item (skips best practices and geometry)
476+
- **Regular mode**: ~1-2ms per item (includes all checks)
477+
- **Speedup**: 4-8x faster for large collections
478+
479+
Use `--fast` when:
480+
- Validating large collections (100+ items)
481+
- You only need STAC spec compliance
482+
- You want to skip best practices checks
483+
- Performance is critical
484+
424485
### STAC API Validation
425486

426487
stac-check can validate STAC API endpoints, including item collections and collections endpoints. It supports pagination and can validate multiple pages of results.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "stac_check"
7-
version = "1.12.0"
7+
version = "1.13.0"
88
description = "Linting and validation tool for STAC assets"
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -16,7 +16,7 @@ dependencies = [
1616
"requests>=2.32.4",
1717
"jsonschema>=4.25.0",
1818
"click>=8.1.8",
19-
"stac-valid~=4.2.0",
19+
"stac-valid~=4.2.2",
2020
"PyYAML",
2121
"python-dotenv",
2222
]
@@ -26,7 +26,7 @@ dev = [
2626
"pytest",
2727
"requests-mock",
2828
"types-setuptools",
29-
"stac-valid[pydantic]~=4.2.0",
29+
"stac-valid[pydantic]~=4.2.2",
3030
]
3131
docs = [
3232
"sphinx>=8.2.3",
@@ -35,7 +35,7 @@ docs = [
3535
"myst-parser>=4.0.1",
3636
"sphinx-autodoc-typehints>=3.2.0",
3737
]
38-
pydantic = ["stac-valid[pydantic]~=4.2.0"]
38+
pydantic = ["stac-valid[pydantic]~=4.2.2"]
3939

4040
[project.urls]
4141
Homepage = "https://github.com/stac-utils/stac-check"

sample_files/1.1.0/extended-item.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
88
"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json"
99
],
10-
"type": "Feature",
1110
"id": "20201211_223832_CS2",
1211
"bbox": [
1312
172.91173669923782,

0 commit comments

Comments
 (0)