heystac
A command-line utility (CLI) for rating and crawling STAC catalogs. heystac generates the ratings for https://www.gadom.ski/heystac/.
Usage
python -m pip install heystac
heystac --help
To rate a STAC catalog, collection, or item:
$ heystac rate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st/items/LC09_L2SP_090091_20241118_20241119_02_T2_ST
5.0 ★★★★★
Any issues will be printed to standard output:
$ heystac rate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st
1.7 ★★
High importance issues
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Rule id | Message |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| validate-core | Validation failed for Collection with ID landsat-c2l2-st against schema at https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
To run json-schema validation on a STAC value:
$ heystac validate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st 2>&1 | tail -n7
Failed validating 'pattern' in schema['allOf'][0]['properties']['license']:
{'title': 'Collection License Name',
'type': 'string',
'pattern': '^[\\w\\-\\.\\+]+$'}
On instance['license']:
'https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/Landsat_Data_Policy.pdf'
To crawl a catalog and save the crawl to a directory:
heystac crawl https://landsatlook.usgs.gov/stac-server usgs-landsat
Definitions
We've made some opinionated decisions about behavior in this CLI.
Rate
A Rating is generated by applying a set of Rules to a STAC value.
This produces one Check per rule.
Each Check has a score between zero and one:
0: the STAC value failed the check1: the STAC value passed the check- Something between
0and1: the STAC value partially failed the check, e.g. if the check was for valid links and some links were valid and some were not
Each rule also has an Importance:
highmediumlow
heystac applies a configurable weight to each check based on its importance to produce a score for the STAC value.
That score is converted to stars by the following formula: 5 * score / total, where total is the maximum possible score.
Crawl
When heystac crawls a STAC API, it gets every collection and one item from each collection. The catalog is saved to the local filesystem in the following layout:
catalog.jsoncollection-a/collection.jsoncollection-a/item-from-collection-a.jsoncollection-b/collection.jsoncollection-b/item-from-collection-b.json
The item file names are generated from the item ID, with all / characters replaced by _.
Configuration
heystac comes with a default configuration that should work for most use-cases.
If you want to customize anything, such as the importance weights or the rule descriptions, save the default configuration to a file called heystac.toml:
heystac config > heystac.toml
You can then edit that file to your heart's content.
By default, the CLI will read heystac.toml in your current working directory.
To specify a config file in another location:
heystac --config a/nother/path/config.toml
License
MIT
Metadata
Release files for heystac 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| heystac-0.0.1.tar.gz | 128.2 kB | Without provenance | Details for heystac-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| heystac-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for heystac-0.0.1-py3-none-any.whl |
Total release size: 144.6 kB
Release files / heystac-0.0.1.tar.gz
| Download URL | heystac-0.0.1.tar.gz |
|---|---|
| Size | 128.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
577d89230fbca376dd7a6bf4635b17b97e52f945527448182b00fe4ebdd593bb
|
|
BLAKE2b-256 checksum How to use checksums |
51207d97919b8005de2011a878e3dc26220890445e76a56d6e5645d4f18bf04d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / heystac-0.0.1-py3-none-any.whl
| Download URL | heystac-0.0.1-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81f6cc80029133a59c975c0b3fe5712cb293e96f62265808085bcfbb5883ef08
|
|
BLAKE2b-256 checksum How to use checksums |
87d746d59aa798e0da91908d64de7fffc8f3f6e32ee12372fbb174551c39ebdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for heystac 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.