{"id":13735374,"url":"https://github.com/stac-utils/stac-check","last_synced_at":"2025-06-23T17:12:29.621Z","repository":{"id":41814958,"uuid":"417848015","full_name":"stac-utils/stac-check","owner":"stac-utils","description":"Linting and validation tool for STAC assets","archived":false,"fork":false,"pushed_at":"2023-11-17T14:59:52.000Z","size":330,"stargazers_count":16,"open_issues_count":9,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-11T19:56:51.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stac-utils.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-16T14:14:12.000Z","updated_at":"2024-05-14T15:04:43.000Z","dependencies_parsed_at":"2023-12-18T20:13:30.700Z","dependency_job_id":"a0f29deb-9780-4038-84cc-71a6d23f72ef","html_url":"https://github.com/stac-utils/stac-check","commit_stats":{"total_commits":380,"total_committers":4,"mean_commits":95.0,"dds":"0.013157894736842146","last_synced_commit":"e66e3a355eef8a40bcbb0a926e4d72af86d97666"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stac-utils","download_url":"https://codeload.github.com/stac-utils/stac-check/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224727181,"owners_count":17359532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:06.180Z","updated_at":"2025-06-23T17:12:29.592Z","avatar_url":"https://github.com/stac-utils.png","language":"HTML","funding_links":[],"categories":["`Python` processing of optical imagery (non deep learning)"],"sub_categories":["Cloud Native Geospatial"],"readme":"# stac-check\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/stac-utils/stac-check/main/assets/stac-check.png\" width=560\u003e\n\u003c/p\u003e\n\n[![Downloads](https://static.pepy.tech/badge/stac-check?color=blue)](https://pepy.tech/project/stac-check)\n[![GitHub contributors](https://img.shields.io/github/contributors/stac-utils/stac-check?color=blue)](https://github.com/stac-utils/stac-check/graphs/contributors)\n[![GitHub stars](https://img.shields.io/github/stars/stac-utils/stac-check.svg?color=blue)](https://github.com/stac-utils/stac-check/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/stac-utils/stac-check.svg?color=blue)](https://github.com/stac-utils/stac-check/network/members)\n[![PyPI version](https://img.shields.io/pypi/v/stac-check.svg?color=blue)](https://pypi.org/project/stac-check/)\n[![STAC](https://img.shields.io/badge/STAC-1.1.0-blue.svg)](https://github.com/radiantearth/stac-spec/tree/v1.1.0)\n\n## A linting and validation tool for STAC assets\n\nThe 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)\n\n## Table of Contents\n\n- [Documentation](#documentation)\n- [Installation](#installation)\n  - [Pip](#pip)\n  - [Docker](#docker)\n- [Usage](#usage)\n  - [CLI Usage](#cli-usage)\n  - [Configuration](#configuration)\n  - [Geometry Validation](#geometry-validation)\n  - [Python API Usage](#python-api-usage)\n- [Examples](#examples)\n  - [Basic Validation](#basic-validation)\n  - [Recursive Validation](#recursive-validation)\n  - [Asset Validation](#asset-validation)\n  - [Link and Asset Validation](#link-and-asset-validation)\n  - [Invalid STAC](#invalid-stac)\n  - [Using HTTP Headers](#using-http-headers)\n  - [STAC API Validation](#stac-api-validation)\n- [Development](#development)\n- [Sponsors and Supporters](#sponsors-and-supporters)\n- [Contributing](#contributing)\n  - [How to Contribute](#how-to-contribute)\n  - [Development Guidelines](#development-guidelines)\n  - [Reporting Issues](#reporting-issues)\n- [License](#license)\n\n## Documentation\n\nThe documentation is hosted on GitHub Pages at [stac-utils.github.io/stac-check](https://stac-utils.github.io/stac-check/).\n\n### Building Documentation Locally\n\nTo build the documentation locally:\n\n```bash\n# Install the package with documentation dependencies\npip install -e \".[docs]\"\n\n# Build the documentation\nmake docs\n```\n\nThe built documentation will be available in the `docs/_build/html` directory.\n\nAlternatively, you can build the documentation using Docker:\n\n```bash\n# Build the Docker image and documentation\nmake docker-docs\n```\n\n## Installation\n\n### Pip\n\n```bash\n$ pip install stac-check\n```\n\nFor local development:\n\n```bash\n$ pip install -e '.[dev]'\n```\n\n### Docker\n\n```bash\n$ make build\n$ make shell\n```\n\n## Usage\n\n### CLI Usage\n\n```\nUsage: stac-check [OPTIONS] FILE\n\nOptions:\n  --version                Show the version and exit.\n  -l, --links              Validate links for format and response.\n  -a, --assets             Validate assets for format and response.\n  -m, --max-depth INTEGER  Maximum depth to traverse when recursing. Omit this\n                           argument to get full recursion. Ignored if\n                           `recursive == False`.\n  -r, --recursive          Recursively validate all related stac objects.\n  --no-assets-urls         Disables the opening of href links when validating assets\n                           (enabled by default).\n  --header KEY VALUE       HTTP header to include in the requests. Can be used\n                           multiple times.\n  --pydantic               Use stac-pydantic for enhanced validation with Pydantic models.\n  --verbose                Show verbose error messages.\n  -o, --output FILE        Save output to the specified file.\n  --item-collection        Validate item collection response. Can be combined with\n                           --pages. Defaults to one page.\n  --collections            Validate collections endpoint response. Can be combined with\n                           --pages. Defaults to one page.\n  -p, --pages INTEGER      Maximum number of pages to validate via --item-collection\n                           or --collections. Defaults to one page.\n  --help                   Show this message and exit.\n```\n\n### Configuration\n\nstac-check uses a configuration file to control which validation checks are performed. By default, it uses the built-in configuration at `stac_check/stac-check.config.yml`. You can customize the validation behavior by creating your own configuration file.\n\nThe configuration file has three main sections:\n\n1. **linting**: Controls which general best practices checks are enabled\n2. **geometry_validation**: Controls geometry-specific validation checks [BETA]\n3. **settings**: Configures thresholds for certain checks\n\nHere's an example of the configuration options:\n\n```yaml\nlinting:\n  # Identifiers should consist of only lowercase characters, numbers, '_', and '-'\n  searchable_identifiers: true\n  # Item name '{self.object_id}' should not contain ':' or '/'\n  percent_encoded: true\n  # Item file names should match their ids\n  item_id_file_name: true\n  # Collections and catalogs should be named collection.json and catalog.json\n  catalog_id_file_name: true\n  # A STAC collection should contain a summaries field\n  check_summaries: true\n  # Datetime fields should not be set to null\n  null_datetime: true\n  # best practices - check unlocated items to make sure bbox field is not set\n  check_unlocated: true\n  # best practices - recommend items have a geometry\n  check_geometry: true\n  # check to see if there are too many links\n  bloated_links: true\n  # best practices - check for bloated metadata in properties\n  bloated_metadata: true\n  # best practices - ensure thumbnail is a small file size [\"png\", \"jpeg\", \"jpg\", \"webp\"]\n  check_thumbnail: true\n  # best practices - ensure that links in catalogs and collections include a title field\n  links_title: true\n  # best practices - ensure that links in catalogs and collections include self link\n  links_self: true\n\ngeometry_validation:\n  # Master switch to enable/disable all geometry validation checks\n  enabled: true\n  # check if geometry coordinates are potentially ordered incorrectly (longitude, latitude)\n  geometry_coordinates_order: true\n  # check if geometry coordinates contain definite errors (latitude \u003e ±90°, longitude \u003e ±180°)\n  geometry_coordinates_definite_errors: true\n  # check if bbox matches the bounds of the geometry\n  bbox_geometry_match: true\n  # check if a bbox that crosses the antimeridian is correctly formatted\n  bbox_antimeridian: true\n\nsettings:\n  # number of links before the bloated links warning is shown\n  max_links: 20\n  # number of properties before the bloated metadata warning is shown\n  max_properties: 20\n```\n\nTo use a custom configuration file, set the `STAC_CHECK_CONFIG` environment variable to the path of your configuration file:\n\n```bash\nexport STAC_CHECK_CONFIG=/path/to/your/config.yml\nstac-check sample_files/1.0.0/core-item.json\n```\n\n### Geometry Validation\n\nGeometry validation is a feature of stac-check that allows you to validate the geometry of your STAC items. This feature is enabled by default, but can be disabled by setting `geometry_validation.enabled` to `false` in your configuration file.\n\nThe geometry validation feature checks for the following:\n\n*   Geometry coordinates are potentially ordered incorrectly (longitude, latitude)\n*   Geometry coordinates contain definite errors (latitude \u003e ±90°, longitude \u003e ±180°)\n*   Bbox matches the bounds of the geometry\n*   Bbox that crosses the antimeridian is correctly formatted\n\nYou can customize the geometry validation behavior by setting the following options in your configuration file:\n\n*   `geometry_validation.geometry_coordinates_order`: Check if geometry coordinates are potentially ordered incorrectly (longitude, latitude)\n*   `geometry_validation.geometry_coordinates_definite_errors`: Check if geometry coordinates contain definite errors (latitude \u003e ±90°, longitude \u003e ±180°)\n*   `geometry_validation.bbox_geometry_match`: Check if bbox matches the bounds of the geometry\n*   `geometry_validation.bbox_antimeridian`: Check if a bbox that crosses the antimeridian is correctly formatted\n\n### Python API Usage\n\n```python\nfrom stac_check.lint import Linter\n\nlinter = Linter('\u003cjson_path\u003e')\n\nfor k, v in linter.create_best_practices_dict().items():\n    print(k, \":\", v)\n```\n\n## Examples\n\n### Basic Validation\n\n```bash\nstac-check sample_files/0.9.0/landsat8-sample.json\n```\n\n\u003cpre\u003e\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 0.9.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\nValid ITEM: True\n\nSchemas validated:\n    https://cdn.staclint.com/v0.9.0/extension/eo.json\n    https://cdn.staclint.com/v0.9.0/extension/view.json\n    https://cdn.staclint.com/v0.9.0/item.json\n\nSTAC Best Practices:\n    Item name 'LC81530252014153LGN00' should only contain Searchable identifiers\n    Identifiers should consist of only lowercase characters, numbers, '_', and '-'\n    https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers\n\n    Item file names should match their ids: 'landsat8-sample' not equal to 'LC81530252014153LGN00\n\n    A link to 'self' in links is strongly recommended\n\n\nThis object has 4 links\n\u003c/pre\u003e\n\n### Recursive Validation\n\n```bash\nstac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive\n```\n\n\u003cpre\u003e\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 0.9.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\n\nRecursive: Validate all assets in a collection or catalog\nMax-depth = None\n-------------------------\nAsset 1 Validated: https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json\n\nValid COLLECTION: True\n\nSchemas validated:\n    https://cdn.staclint.com/v0.9.0/collection.json\n\nSTAC Best Practices:\n    Object should be called 'collection.json' not 'landsat-collection.json'\n\n    A STAC collection should contain a summaries field\n    It is recommended to store information like eo:bands in summaries\n\n    Links in catalogs and collections should always have a 'title' field\n\nThis object has 4 links\n\n-------------------------\nAsset 2 Validated: https://landsat-stac.s3.amazonaws.com/landsat-8-l1/paths/catalog.json\n\nValid: False\nSchemas validated:\n    https://cdn.staclint.com/v0.9.0/collection.json\nError Type: JSONDecodeError\nError Message: Expecting value: line 1 column 1 (char 0)\n-------------------------\n\u003c/pre\u003e\n\n\n### Asset Validation\n\n```bash\nstac-check sample_files/1.0.0/core-item.json --assets\n```\n\n\u003cpre\u003e\n\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 1.0.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\nValid ITEM: True\n\nSchemas validated:\n    https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\n\nSTAC Best Practices:\n    Item name '20201211_223832_CS2' should only contain Searchable identifiers\n    Identifiers should consist of only lowercase characters, numbers, '_', and '-'\n    https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers\n\n    Item file names should match their ids: 'core-item' not equal to '20201211_223832_CS2\n\n    Please avoid setting the datetime field to null, many clients search on this field\n\n    A link to 'self' in links is strongly recommended\n\n\nNo ASSET format errors!\n\nASSET request errors:\n    http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH\n\nThis object has 4 links\n\u003c/pre\u003e\n\n### Link and Asset Validation\n\n```bash\nstac-check sample_files/1.0.0/core-item-bad-links.json --links --assets\n```\n\n\u003cpre\u003e\n\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 1.0.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\nValid ITEM: True\n\nSchemas validated:\n    https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\n\nSTAC Best Practices:\n    Item name '20201211_223832_CS2' should only contain Searchable identifiers\n    Identifiers should consist of only lowercase characters, numbers, '_', and '-'\n    https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers\n\n    Item file names should match their ids: 'core-item-bad-links' not equal to '20201211_223832_CS2\n\n    Please avoid setting the datetime field to null, many clients search on this field\n\n    A link to 'self' in links is strongly recommended\n\n\nASSET format errors:\n    https:/storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg\n\nASSET request errors:\n    https:/storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg\n    http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH\n\nLINK format errors:\n    http:/remotdata.io/catalog/20201211_223832_CS2/index.html\n\nLINK request errors:\n    http://catalog/collection.json\n    http:/remotdata.io/catalog/20201211_223832_CS2/index.html\n\nThis object has 4 links\n\u003c/pre\u003e\n\n### Invalid STAC\n\n```bash\nstac-check sample_files/0.9.0/bad-item.json\n```\n\n\u003cpre\u003e\n\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 0.9.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\nValid : False\n\nSchemas validated:\n    https://cdn.staclint.com/v0.9.0/item.json\n\nSTAC Best Practices:\n    A link to 'self' in links is strongly recommended\n\nValidation error type:\n    ValidationError\nValidation error message:\n    'id' is a required property of the root of the STAC object\n\nThis object has 5 links\n\u003c/pre\u003e\n\n### Using HTTP Headers\n\n```bash\nstac-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\n```\n\n\u003cpre\u003e\n\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nPlease upgrade from version 1.0.0 to version 1.1.0!\n\nValidator: stac-validator 3.9.1\n\nValid ITEM: True\n\nSchemas validated: \n    https://stac-extensions.github.io/timestamps/v1.1.0/schema.json\n    https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\n\nSTAC Best Practices: \n    A STAC collection should contain a summaries field\n    It is recommended to store information like eo:bands in summaries\n\n\nNo ASSET format errors!\n\nThis object has 4 links\n\u003c/pre\u003e\n\n### STAC API Validation\n\nstac-check can validate STAC API endpoints, including item collections and collections endpoints. It supports pagination and can validate multiple pages of results.\n\n**Validating an Item Collection Endpoint:**\n\n```bash\nstac-check https://stac.geobon.org/collections/chelsa-clim/items --item-collection\n```\n\n\u003cpre\u003e\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nValidator: stac-validator 3.9.1\n\nItem Collection: Validate all assets in a feature collection\nPages = 1\n\nValid ITEM: True\n\nSchemas validated:\n    https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\n\nThis object has 10 items\n\u003c/pre\u003e\n\n**Validating Multiple Pages of an Item Collection:**\n\n```bash\nstac-check https://stac.geobon.org/collections/chelsa-clim/items --item-collection --pages 3\n```\n\n\u003cpre\u003e\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nValidator: stac-validator 3.9.1\n\nItem Collection: Validate all assets in a feature collection\nPages = 3\n\nValid ITEM: True\n\nSchemas validated:\n    https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json\n\nThis object has 30 items\n\u003c/pre\u003e\n\n**Validating a Collections Endpoint:**\n\n```bash\nstac-check https://stac.geobon.org/collections --collections\n```\n\n\u003cpre\u003e\u003cb\u003estac-check: STAC spec validation and linting tool\u003c/b\u003e\n\nValidator: stac-validator 3.9.1\n\nCollections: Validate all collections in a STAC API\nPages = 1\n\nValid COLLECTION: True\n\nSchemas validated:\n    https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json\n\nThis object has 5 collections\n\u003c/pre\u003e\n\n## Development\n\nCreate local docs in the /docs folder:\n\n```bash\n$ pdoc --output-dir pdoc ./stac_check\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\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://healy-hyperspatial.github.io/\"\u003e\u003cimg 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\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://radiant.earth/\"\u003e\u003cimg src=\"assets/radiant-earth.webp\" alt=\"Radiant Earth Foundation\" height=\"100\" hspace=\"20\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nWe 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!\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### How to Contribute\n\n1. **Fork the repository** - Create your own fork of the project\n2. **Create a feature branch** - `git checkout -b feature/your-feature-name`\n3. **Commit your changes** - Make sure to write clear, concise commit messages\n4. **Push to your branch** - `git push origin feature/your-feature-name`\n5. **Open a Pull Request** - Describe your changes in detail\n\n### Development Guidelines\n\n- Follow the existing code style\n- Add tests for new features\n- Update documentation as needed\n- Make sure all tests pass before submitting a PR\n\n### Reporting Issues\n\nIf 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).\n\n## License\n\nThis project is licensed under the Apache License 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstac-utils%2Fstac-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-check/lists"}