# SpatioTemporal Asset Catalog Validator
<!-- markdownlint-disable MD033 MD041 -->
<p align="left">
<img src="https://raw.githubusercontent.com/stac-utils/stac-validator/main/assets/stac-validator.png" width=560>
</p>
[](https://pepy.tech/projects/stac-validator)
[](https://github.com/stac-utils/stac-validator/graphs/contributors)
[](https://github.com/stac-utils/stac-validator/stargazers)
[](https://github.com/stac-utils/stac-validator/network/members)
[](https://pypi.org/project/stac-validator/)
[](https://github.com/radiantearth/stac-spec/tree/v1.1.0)
## Table of Contents
- [Overview](#overview)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [Installation](#install)
- [Supported STAC Versions](#versions-supported)
- [Usage](#usage)
- [CLI](#cli)
- [Python](#python)
- [Examples](#additional-examples)
- [Core Validation](#--core)
- [Custom Schema](#--custom)
- [Extensions Validation](#--extensions)
- [Recursive Validation](#--recursive)
- [Item Collection Validation](#--item-collection)
- [Using Headers](#--header)
- [Schema Mapping](#--schema-map)
- [Schema Config](#--schema-config)
- [Pydantic Validation](#--pydantic)
- [Deployment](#deployment)
- [Docker](#docker)
- [AWS (CDK)](#aws-cdk)
- [Testing](#testing)
- [Related Projects](#related-projects)
- [Sponsors and Supporters](#sponsors-and-supporters)
- [Contributing](#contributing)
- [License](#license)
## Overview
STAC Validator is a tool to validate [STAC (SpatioTemporal Asset Catalog)](https://github.com/radiantearth/stac-spec) json files against the official STAC specification. It provides both a command-line interface and a Python API for validating STAC objects.
## Documentation
For detailed documentation, please visit our [GitHub Pages documentation site](https://stac-utils.github.io/stac-validator/).
## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
"schema": [
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json",
"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "default"
}
]
```
## Requirements
- Python 3.8+
- Requests
- Click
- Jsonschema
## Related Projects
Note: Stac-validator is also used in stac-check which adds linting messages based on the official STAC best practices document.
https://github.com/stac-utils/stac-check
## Install
### Installation from PyPi
```bash
$ pip install stac-validator
```
### Installation from Repo
```bash
$ pip install .
```
or for local development
```bash
$ pip install -e '.[dev]'
```
The [Makefile](./Makefile) has convenience commands if Make is installed.
```bash
$ make help
```
## Versions supported
| STAC |
| ------------ |
| 0.8.0 |
| 0.8.1 |
| 0.9.0 |
| 1.0.0-beta.1 |
| 1.0.0-beta.2 |
| 1.0.0-rc.1 |
| 1.0.0-rc.2 |
| 1.0.0-rc.3 |
| 1.0.0-rc.4 |
| 1.0.0 |
| 1.1.0-beta.1 |
| 1.1.0 |
## Usage
### CLI
**Basic Usage**
```bash
$ stac-validator --help
```
```bash
Usage: stac-validator [OPTIONS] STAC_FILE
Options:
--core Validate core stac object only without
extensions.
--extensions Validate extensions only.
--links Additionally validate links. Only works with
default mode.
--assets Additionally validate assets. Only works
with default mode.
-c, --custom TEXT Validate against a custom schema (local
filepath or remote schema).
-s, --schema-map <TEXT TEXT>...
Schema path to replaced by (local) schema
path during validation. Can be used multiple
times.
-r, --recursive Recursively validate all related stac
objects.
-m, --max-depth INTEGER Maximum depth to traverse when recursing.
Omit this argument to get full recursion.
Ignored if `recursive == False`.
--collections Validate /collections response.
--item-collection Validate item collection response. Can be
combined with --pages. Defaults to one page.
--no-assets-urls Disables the opening of href links when
validating assets (enabled by default).
--header <TEXT TEXT>... HTTP header to include in the requests. Can
be used multiple times.
-p, --pages INTEGER Maximum number of pages to validate via
--item-collection. Defaults to one page.
-t, --trace-recursion Enables verbose output for recursive mode.
--no_output Do not print output to console.
--log_file TEXT Save full recursive output to log file
(local filepath).
--pydantic Validate using stac-pydantic models for enhanced
type checking and validation.
--schema-config TEXT Path to a YAML or JSON schema config file.
--verbose Enable verbose output. This will output
additional information during validation.
--help Show this message and exit.
```
### Python
**Remote source**
```python
from stac_validator import stac_validator
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")
stac.run()
print(stac.message)
```
```python
[
{
"version": "0.9.0",
"path": "https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json",
"schema": [
"https://cdn.staclint.com/v0.9.0/collection.json"
],
"valid_stac": true,
"asset_type": "COLLECTION",
"validation_method": "default"
}
]
```
**Local file**
```python
from stac_validator import stac_validator
stac = stac_validator.StacValidate("tests/test_data/1beta1/sentinel2.json", extensions=True)
stac.run()
print(stac.message)
```
```python
[
{
"version": "1.0.0-beta.1",
"path": "tests/test_data/1beta1/sentinel2.json",
"schema": [
"https://cdn.staclint.com/v1.0.0-beta.1/collection.json"
],
"valid_stac": true,
"asset_type": "COLLECTION",
"validation_method": "extensions"
}
]
```
**Dictionary**
```python
from stac_validator import stac_validator
stac = stac_validator.StacValidate()
stac.validate_dict(dictionary)
print(stac.message)
```
**Item Collection**
```python
from stac_validator import stac_validator
stac = stac_validator.StacValidate()
stac.validate_item_collection_dict(item_collection_dict)
print(stac.message)
```
## Deployment
### Docker
The validator can run using docker containers.
```bash
$ docker build -t stac-validator .
$ docker run stac-validator https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json",
"schema": [
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "default"
}
]
```
### AWS (CDK)
An example [AWS CDK](https://aws.amazon.com/cdk/) deployment is available in [cdk-deployment](./cdk-deployment/README.md)
```bash
$ cd cdk-deployment
$ cdk diff
```
## Testing
```bash
$ make test
# or
$ pytest -v
```
See the [tests](./tests/test_stac_validator.py) files for examples on different usages.
## Additional Examples
### --core
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --core
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
"schema": [
"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "core"
}
]
```
### --custom
```bash
$ stac-validator https://radarstac.s3.amazonaws.com/stac/catalog.json --custom https://cdn.staclint.com/v0.7.0/catalog.json
```
```bash
[
{
"version": "0.7.0",
"path": "https://radarstac.s3.amazonaws.com/stac/catalog.json",
"schema": [
"https://cdn.staclint.com/v0.7.0/catalog.json"
],
"asset_type": "CATALOG",
"validation_method": "custom",
"valid_stac": true
}
]
```
### --extensions
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --extensions
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
"schema": [
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "extensions"
}
]
```
### --recursive
```bash
$ stac-validator https://spot-canada-ortho.s3.amazonaws.com/catalog.json --recursive --max-depth 1 --trace-recursion
```
```bash
[
{
"version": "0.8.1",
"path": "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot4_orthoimages/collection.json",
"schema": "https://cdn.staclint.com/v0.8.1/collection.json",
"asset_type": "COLLECTION",
"validation_method": "recursive",
"valid_stac": true
},
{
"version": "0.8.1",
"path": "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/collection.json",
"schema": "https://cdn.staclint.com/v0.8.1/collection.json",
"asset_type": "COLLECTION",
"validation_method": "recursive",
"valid_stac": true
},
{
"version": "0.8.1",
"path": "https://spot-canada-ortho.s3.amazonaws.com/catalog.json",
"schema": "https://cdn.staclint.com/v0.8.1/catalog.json",
"asset_type": "CATALOG",
"validation_method": "recursive",
"valid_stac": true
}
]
```
### --item-collection
```bash
$ stac-validator https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a/items --item-collection --pages 2
```
### --header
```bash
$ stac-validator https://stac-catalog.eu/collections/sentinel-s2-l2a/items --header x-api-key $MY_API_KEY --header foo bar
```
### --schema-map
Schema map allows stac-validator to replace a schema in a STAC json by a schema from another URL or local schema file.
This is especially useful when developing a schema and testing validation against your local copy of the schema.
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json --extensions --schema-map https://stac-extensions.github.io/projection/v1.0.0/schema.json "tests/test_data/schema/v1.0.0/projection.json"
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json",
"schema": [
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"tests/test_data/schema/v1.0.0/projection.json",
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "extensions"
}
]
```
This option is also capable of replacing URLs to subschemas:
```bash
$ stac-validator tests/test_data/v100/extended-item-local.json --custom tests/test_data/schema/v1.0.0/item_with_unreachable_url.json --schema-map https://geojson-wrong-url.org/schema/Feature.json https://geojson.org/schema/Feature.json --schema-map https://geojson-wrong-url.org/schema/Geometry.json https://geojson.org/schema/Geometry.json
```
```bash
[
{
"version": "1.0.0",
"path": "tests/test_data/v100/extended-item-local.json",
"schema": [
"tests/test_data/schema/v1.0.0/item_with_unreachable_url.json"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "custom"
}
]
```
### --schema-config
The `--schema-config` option allows you to specify a YAML or JSON configuration file that maps remote schema URLs to local file paths. This is useful when you need to validate against multiple local schemas and want to avoid using multiple `--schema-map` arguments.
Example schema config file (YAML):
```yaml
schemas:
"https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json": "local_schemas/v1.0.0/collection.json"
"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json": "local_schemas/v1.0.0/item.json"
"https://stac-extensions.github.io/eo/v1.0.0/schema.json": "local_schemas/v1.0.0/eo.json"
```
Usage:
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json --schema-config path/to/schema_config.yaml
```
The paths in the config file can be absolute or relative to the config file's location.
### --pydantic
The `--pydantic` option provides enhanced validation using stac-pydantic models, which offer stronger type checking and more detailed error messages. To use this feature, you need to install the optional dependency:
```bash
$ pip install stac-validator[pydantic]
```
Then you can validate your STAC objects using Pydantic models:
```bash
$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --pydantic
```
```bash
[
{
"version": "1.0.0",
"path": "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json",
"schema": [
"stac-pydantic Item model"
],
"valid_stac": true,
"asset_type": "ITEM",
"validation_method": "pydantic",
"extension_schemas": [
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",
"https://stac-extensions.github.io/view/v1.0.0/schema.json",
"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json"
],
"model_validation": "passed"
}
]
```
## 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/)
- [Sparkgeo](https://sparkgeo.com/)
<p align="left">
<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>
<a href="https://radiant.earth/"><img src="assets/radiant-earth.webp" alt="Radiant Earth Foundation" height="100" hspace="20"></a>
<a href="https://sparkgeo.com/"><img src="assets/sparkgeo_logo.jpeg" alt="Sparkgeo" height="100" hspace="20"></a>
</p>
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the Apache License 2.0.
Raw data
{
"_id": null,
"home_page": "https://github.com/stac-utils/stac-validator",
"name": "stac-validator",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "STAC validation raster",
"author": "James Banting, Jonathan Healy",
"author_email": "jonathan.d.healy@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ee/db/f0f96ae82e6407c9bf66b6a05f3062bbb3483a1a6fe684086f604ae8726d/stac_validator-3.10.1.tar.gz",
"platform": null,
"description": "# SpatioTemporal Asset Catalog Validator\n\n<!-- markdownlint-disable MD033 MD041 -->\n\n<p align=\"left\">\n <img src=\"https://raw.githubusercontent.com/stac-utils/stac-validator/main/assets/stac-validator.png\" width=560>\n</p>\n\n[](https://pepy.tech/projects/stac-validator)\n [](https://github.com/stac-utils/stac-validator/graphs/contributors)\n [](https://github.com/stac-utils/stac-validator/stargazers)\n [](https://github.com/stac-utils/stac-validator/network/members)\n [](https://pypi.org/project/stac-validator/)\n [](https://github.com/radiantearth/stac-spec/tree/v1.1.0)\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Documentation](#documentation)\n- [Requirements](#requirements)\n- [Installation](#install)\n- [Supported STAC Versions](#versions-supported)\n- [Usage](#usage)\n - [CLI](#cli)\n - [Python](#python)\n- [Examples](#additional-examples)\n - [Core Validation](#--core)\n - [Custom Schema](#--custom)\n - [Extensions Validation](#--extensions)\n - [Recursive Validation](#--recursive)\n - [Item Collection Validation](#--item-collection)\n - [Using Headers](#--header)\n - [Schema Mapping](#--schema-map)\n - [Schema Config](#--schema-config)\n - [Pydantic Validation](#--pydantic)\n- [Deployment](#deployment)\n - [Docker](#docker)\n - [AWS (CDK)](#aws-cdk)\n- [Testing](#testing)\n- [Related Projects](#related-projects)\n- [Sponsors and Supporters](#sponsors-and-supporters)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nSTAC Validator is a tool to validate [STAC (SpatioTemporal Asset Catalog)](https://github.com/radiantearth/stac-spec) json files against the official STAC specification. It provides both a command-line interface and a Python API for validating STAC objects.\n\n## Documentation\n\nFor detailed documentation, please visit our [GitHub Pages documentation site](https://stac-utils.github.io/stac-validator/).\n\n## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).\n\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json\",\n \"schema\": [\n \"https://stac-extensions.github.io/eo/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/projection/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/scientific/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/view/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json\",\n \"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"default\"\n }\n]\n```\n\n## Requirements\n\n- Python 3.8+\n - Requests\n - Click\n - Jsonschema\n\n## Related Projects\n\nNote: Stac-validator is also used in stac-check which adds linting messages based on the official STAC best practices document. \nhttps://github.com/stac-utils/stac-check\n\n## Install\n\n### Installation from PyPi\n\n```bash\n$ pip install stac-validator\n```\n\n### Installation from Repo\n\n```bash\n$ pip install .\n```\n\nor for local development\n\n```bash\n$ pip install -e '.[dev]'\n```\n\nThe [Makefile](./Makefile) has convenience commands if Make is installed.\n\n```bash\n$ make help\n```\n\n## Versions supported\n\n| STAC |\n| ------------ |\n| 0.8.0 |\n| 0.8.1 |\n| 0.9.0 |\n| 1.0.0-beta.1 |\n| 1.0.0-beta.2 |\n| 1.0.0-rc.1 |\n| 1.0.0-rc.2 |\n| 1.0.0-rc.3 |\n| 1.0.0-rc.4 |\n| 1.0.0 |\n| 1.1.0-beta.1 |\n| 1.1.0 |\n\n## Usage\n\n### CLI\n\n**Basic Usage**\n\n```bash\n$ stac-validator --help\n```\n\n```bash\nUsage: stac-validator [OPTIONS] STAC_FILE\n\nOptions:\n --core Validate core stac object only without\n extensions.\n --extensions Validate extensions only.\n --links Additionally validate links. Only works with\n default mode.\n --assets Additionally validate assets. Only works\n with default mode.\n -c, --custom TEXT Validate against a custom schema (local\n filepath or remote schema).\n -s, --schema-map <TEXT TEXT>...\n Schema path to replaced by (local) schema\n path during validation. Can be used multiple\n times.\n -r, --recursive Recursively validate all related stac\n objects.\n -m, --max-depth INTEGER Maximum depth to traverse when recursing.\n Omit this argument to get full recursion.\n Ignored if `recursive == False`.\n --collections Validate /collections response.\n --item-collection Validate item collection response. Can be\n combined with --pages. Defaults to one page.\n --no-assets-urls Disables the opening of href links when\n validating assets (enabled by default).\n --header <TEXT TEXT>... HTTP header to include in the requests. Can\n be used multiple times.\n -p, --pages INTEGER Maximum number of pages to validate via\n --item-collection. Defaults to one page.\n -t, --trace-recursion Enables verbose output for recursive mode.\n --no_output Do not print output to console.\n --log_file TEXT Save full recursive output to log file\n (local filepath).\n --pydantic Validate using stac-pydantic models for enhanced\n type checking and validation.\n --schema-config TEXT Path to a YAML or JSON schema config file.\n --verbose Enable verbose output. This will output\n additional information during validation.\n --help Show this message and exit.\n```\n\n### Python\n\n**Remote source**\n\n```python\nfrom stac_validator import stac_validator\n\nstac = stac_validator.StacValidate(\"https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json\")\nstac.run()\nprint(stac.message)\n```\n```python\n[\n {\n \"version\": \"0.9.0\",\n \"path\": \"https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json\",\n \"schema\": [\n \"https://cdn.staclint.com/v0.9.0/collection.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"COLLECTION\",\n \"validation_method\": \"default\"\n }\n]\n```\n\n**Local file**\n\n```python\nfrom stac_validator import stac_validator\n\nstac = stac_validator.StacValidate(\"tests/test_data/1beta1/sentinel2.json\", extensions=True)\nstac.run()\nprint(stac.message)\n```\n```python\n[\n {\n \"version\": \"1.0.0-beta.1\",\n \"path\": \"tests/test_data/1beta1/sentinel2.json\",\n \"schema\": [\n \"https://cdn.staclint.com/v1.0.0-beta.1/collection.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"COLLECTION\",\n \"validation_method\": \"extensions\"\n }\n]\n```\n\n**Dictionary**\n\n```python\nfrom stac_validator import stac_validator\n\nstac = stac_validator.StacValidate()\nstac.validate_dict(dictionary)\nprint(stac.message)\n```\n\n**Item Collection**\n\n```python\nfrom stac_validator import stac_validator\n\nstac = stac_validator.StacValidate()\nstac.validate_item_collection_dict(item_collection_dict)\nprint(stac.message)\n```\n\n## Deployment\n\n### Docker\n\nThe validator can run using docker containers.\n\n```bash\n$ docker build -t stac-validator .\n$ docker run stac-validator https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/stac-extensions/projection/main/examples/item.json\",\n \"schema\": [\n \"https://stac-extensions.github.io/projection/v1.0.0/schema.json\",\n \"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"default\"\n }\n]\n```\n\n### AWS (CDK)\n\nAn example [AWS CDK](https://aws.amazon.com/cdk/) deployment is available in [cdk-deployment](./cdk-deployment/README.md)\n\n```bash\n$ cd cdk-deployment\n$ cdk diff\n```\n\n## Testing\n\n```bash\n$ make test\n# or\n$ pytest -v\n```\n\nSee the [tests](./tests/test_stac_validator.py) files for examples on different usages.\n\n## Additional Examples\n\n### --core\n\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --core\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json\",\n \"schema\": [\n \"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"core\"\n }\n]\n```\n\n### --custom\n\n```bash\n$ stac-validator https://radarstac.s3.amazonaws.com/stac/catalog.json --custom https://cdn.staclint.com/v0.7.0/catalog.json\n```\n\n```bash\n[\n {\n \"version\": \"0.7.0\",\n \"path\": \"https://radarstac.s3.amazonaws.com/stac/catalog.json\",\n \"schema\": [\n \"https://cdn.staclint.com/v0.7.0/catalog.json\"\n ],\n \"asset_type\": \"CATALOG\",\n \"validation_method\": \"custom\",\n \"valid_stac\": true\n }\n]\n```\n\n### --extensions\n\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --extensions\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json\",\n \"schema\": [\n \"https://stac-extensions.github.io/eo/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/projection/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/scientific/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/view/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"extensions\"\n }\n]\n```\n\n### --recursive\n\n```bash\n$ stac-validator https://spot-canada-ortho.s3.amazonaws.com/catalog.json --recursive --max-depth 1 --trace-recursion\n```\n\n```bash\n[\n {\n \"version\": \"0.8.1\",\n \"path\": \"https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot4_orthoimages/collection.json\",\n \"schema\": \"https://cdn.staclint.com/v0.8.1/collection.json\",\n \"asset_type\": \"COLLECTION\",\n \"validation_method\": \"recursive\",\n \"valid_stac\": true\n },\n {\n \"version\": \"0.8.1\",\n \"path\": \"https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/collection.json\",\n \"schema\": \"https://cdn.staclint.com/v0.8.1/collection.json\",\n \"asset_type\": \"COLLECTION\",\n \"validation_method\": \"recursive\",\n \"valid_stac\": true\n },\n {\n \"version\": \"0.8.1\",\n \"path\": \"https://spot-canada-ortho.s3.amazonaws.com/catalog.json\",\n \"schema\": \"https://cdn.staclint.com/v0.8.1/catalog.json\",\n \"asset_type\": \"CATALOG\",\n \"validation_method\": \"recursive\",\n \"valid_stac\": true\n }\n]\n```\n\n### --item-collection\n\n```bash\n$ stac-validator https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a/items --item-collection --pages 2\n```\n\n### --header\n\n```bash\n$ stac-validator https://stac-catalog.eu/collections/sentinel-s2-l2a/items --header x-api-key $MY_API_KEY --header foo bar\n```\n\n### --schema-map\n\nSchema map allows stac-validator to replace a schema in a STAC json by a schema from another URL or local schema file.\nThis is especially useful when developing a schema and testing validation against your local copy of the schema.\n\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json --extensions --schema-map https://stac-extensions.github.io/projection/v1.0.0/schema.json \"tests/test_data/schema/v1.0.0/projection.json\"\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json\",\n \"schema\": [\n \"https://stac-extensions.github.io/eo/v1.0.0/schema.json\",\n \"tests/test_data/schema/v1.0.0/projection.json\",\n \"https://stac-extensions.github.io/scientific/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/view/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"extensions\"\n }\n]\n```\n\nThis option is also capable of replacing URLs to subschemas:\n\n```bash\n$ stac-validator tests/test_data/v100/extended-item-local.json --custom tests/test_data/schema/v1.0.0/item_with_unreachable_url.json --schema-map https://geojson-wrong-url.org/schema/Feature.json https://geojson.org/schema/Feature.json --schema-map https://geojson-wrong-url.org/schema/Geometry.json https://geojson.org/schema/Geometry.json\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"tests/test_data/v100/extended-item-local.json\",\n \"schema\": [\n \"tests/test_data/schema/v1.0.0/item_with_unreachable_url.json\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"custom\"\n }\n]\n```\n\n### --schema-config\n\nThe `--schema-config` option allows you to specify a YAML or JSON configuration file that maps remote schema URLs to local file paths. This is useful when you need to validate against multiple local schemas and want to avoid using multiple `--schema-map` arguments.\n\nExample schema config file (YAML):\n```yaml\nschemas:\n \"https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json\": \"local_schemas/v1.0.0/collection.json\"\n \"https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\": \"local_schemas/v1.0.0/item.json\"\n \"https://stac-extensions.github.io/eo/v1.0.0/schema.json\": \"local_schemas/v1.0.0/eo.json\"\n```\n\nUsage:\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/v1.0.0/examples/extended-item.json --schema-config path/to/schema_config.yaml\n```\n\nThe paths in the config file can be absolute or relative to the config file's location.\n\n### --pydantic\n\nThe `--pydantic` option provides enhanced validation using stac-pydantic models, which offer stronger type checking and more detailed error messages. To use this feature, you need to install the optional dependency:\n\n```bash\n$ pip install stac-validator[pydantic]\n```\n\nThen you can validate your STAC objects using Pydantic models:\n\n```bash\n$ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json --pydantic\n```\n\n```bash\n[\n {\n \"version\": \"1.0.0\",\n \"path\": \"https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json\",\n \"schema\": [\n \"stac-pydantic Item model\"\n ],\n \"valid_stac\": true,\n \"asset_type\": \"ITEM\",\n \"validation_method\": \"pydantic\",\n \"extension_schemas\": [\n \"https://stac-extensions.github.io/eo/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/projection/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/scientific/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/view/v1.0.0/schema.json\",\n \"https://stac-extensions.github.io/remote-data/v1.0.0/schema.json\"\n ],\n \"model_validation\": \"passed\"\n }\n]\n```\n\n## Sponsors and Supporters\n\nThe following organizations have contributed time and/or funding to support the development of this project:\n- [Healy Hyperspatial](https://healy-hyperspatial.github.io/)\n- [Radiant Earth Foundation](https://radiant.earth/)\n- [Sparkgeo](https://sparkgeo.com/)\n\n<p align=\"left\">\n <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>\n <a href=\"https://radiant.earth/\"><img src=\"assets/radiant-earth.webp\" alt=\"Radiant Earth Foundation\" height=\"100\" hspace=\"20\"></a>\n <a href=\"https://sparkgeo.com/\"><img src=\"assets/sparkgeo_logo.jpeg\" alt=\"Sparkgeo\" height=\"100\" hspace=\"20\"></a>\n</p>\n\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the Apache License 2.0.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A package to validate STAC files",
"version": "3.10.1",
"project_urls": {
"Homepage": "https://github.com/stac-utils/stac-validator"
},
"split_keywords": [
"stac",
"validation",
"raster"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "83593ace9cedb6ab027465b4af47226e3fecbb55bce7af44b95715c873f674c2",
"md5": "4a2d5554822e674349fe4594d81e083f",
"sha256": "7da519c36c3f28a658f18c4630300bf917dc3be41e0e7c3a6d95f5b3dbaa9b21"
},
"downloads": -1,
"filename": "stac_validator-3.10.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4a2d5554822e674349fe4594d81e083f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 25454,
"upload_time": "2025-07-26T13:07:54",
"upload_time_iso_8601": "2025-07-26T13:07:54.850824Z",
"url": "https://files.pythonhosted.org/packages/83/59/3ace9cedb6ab027465b4af47226e3fecbb55bce7af44b95715c873f674c2/stac_validator-3.10.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "eedbf0f96ae82e6407c9bf66b6a05f3062bbb3483a1a6fe684086f604ae8726d",
"md5": "ec7ee5181e481b8a98443174bac85e7d",
"sha256": "f97d05c783433c5715b1d7a7dba5bf8200c94c18f5d1561aa61f872eb12c4c81"
},
"downloads": -1,
"filename": "stac_validator-3.10.1.tar.gz",
"has_sig": false,
"md5_digest": "ec7ee5181e481b8a98443174bac85e7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 27625,
"upload_time": "2025-07-26T13:07:56",
"upload_time_iso_8601": "2025-07-26T13:07:56.174106Z",
"url": "https://files.pythonhosted.org/packages/ee/db/f0f96ae82e6407c9bf66b6a05f3062bbb3483a1a6fe684086f604ae8726d/stac_validator-3.10.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 13:07:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stac-utils",
"github_project": "stac-validator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "stac-validator"
}