Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Spatial Temporal Asset Catalog (STAC) Validator

This utility allows users to validate catalog and/or item json files against the [STAC](https://github.com/radiantearth/stac-spec) spec.
[![CircleCI](https://circleci.com/gh/sparkgeo/stac-validator.svg?style=svg)](https://circleci.com/gh/sparkgeo/stac-validator)

This utility allows users to validate STAC json files against the [STAC](https://github.com/radiantearth/stac-spec) spec.

It can be installed as command line utility and passed either a local file path or a url along with the STAC version to validate against.

Expand All @@ -10,9 +12,6 @@ It can be installed as command line utility and passed either a local file path
* Requests
* Docopt
* pytest
* cachetools
* trio
* asks

## Example

Expand All @@ -34,7 +33,7 @@ Options:
--threads NTHREADS Number of threads to use. [default: 10]
--verbose Verbose output. [default: False]
--timer Reports time to validate the STAC (seconds)
--loglevel LOGLEVEL Standard level of logging to report. [default: CRITICAL]
--log_level LOGLEVEL Standard level of logging to report. [default: CRITICAL]

stac_validator https://cbers-stac.s3.amazonaws.com/CBERS4/MUX/057/122/catalog.json -v v0.5.2
```
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.2.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ requests>=2.19.1
pytest>=3.8.0
docopt>=0.6.2
jsonschema>=2.6.0
cachetools>=2.1.0

9 changes: 5 additions & 4 deletions stac_validator/stac_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def _determine_verison(self):
self.CATALOG_URL = os.path.join(cdn_base_url, self.filename)
self.COLLECTION_URL = os.path.join(cdn_base_url, self.filename)
else:

if self.version in old_versions:
self.CATALOG_URL = os.path.join(
git_base_url, f"static-catalog/{self.input_type}/{self.filename}"
Expand Down Expand Up @@ -75,7 +76,7 @@ def fix_stac_item(version, filename):
return filename

@classmethod
def catalog_schema_url(cls, version, filename="catalog.json"):
def get_catalog_schema_url(cls, version, filename="catalog.json"):
"""
Return path to catalog spec
:param version: version to validate
Expand All @@ -85,7 +86,7 @@ def catalog_schema_url(cls, version, filename="catalog.json"):
return cls(version, "json-schema", filename).CATALOG_URL

@classmethod
def collection_schema_url(cls, version, filename="collection.json"):
def get_collection_schema_url(cls, version, filename="collection.json"):
"""
Return path to collection spec
:param version: version to validate
Expand All @@ -95,7 +96,7 @@ def collection_schema_url(cls, version, filename="collection.json"):
return cls(version, "json-schema", filename).COLLECTION_URL

@classmethod
def item_schema_url(cls, version, filename="stac-item.json"):
def get_item_schema_url(cls, version, filename="stac-item.json"):
"""
Return path to item spec
:param version: version to validate
Expand All @@ -107,7 +108,7 @@ def item_schema_url(cls, version, filename="stac-item.json"):
return cls(version, "json-schema", filename).ITEM_URL

@classmethod
def item_geojson_schema_url(cls, version, filename="geojson.json"):
def get_geojson_schema_url(cls, version, filename="geojson.json"):
"""
Return path to item geojson spec
:param version: version to validate
Expand Down
Loading