Name | heystac JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Command-line interface (CLI) to rate and crawl STAC |
upload_time | 2024-11-19 19:21:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | Copyright 2024 Pete Gadomski <pete.gadomski@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
stac
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# heystac
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/gadomski/heystac/ci.yaml?style=for-the-badge)](https://github.com/gadomski/heystac/actions/workflows/ci.yaml)
A command-line utility (CLI) for rating and crawling [STAC](https://stacspec.org/) catalogs.
**heystac** generates the ratings for <https://www.gadom.ski/heystac/>.
## Usage
```shell
python -m pip install heystac
heystac --help
```
To [rate](#rate) a STAC catalog, collection, or item:
```shell
$ 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:
```shell
$ 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](https://json-schema.org/) validation on a STAC value:
```shell
$ 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](#crawl) a catalog and save the crawl to a directory:
```shell
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 check
- `1`: the STAC value passed the check
- Something between `0` and `1`: 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`:
- `high`
- `medium`
- `low`
**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.json`
- `collection-a/collection.json`
- `collection-a/item-from-collection-a.json`
- `collection-b/collection.json`
- `collection-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`:
```shell
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:
```shell
heystac --config a/nother/path/config.toml
```
## License
MIT
Raw data
{
"_id": null,
"home_page": null,
"name": "heystac",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "stac",
"author": null,
"author_email": "Pete Gadomski <pete.gadomski@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/51/20/7d97919b8005de2011a878e3dc26220890445e76a56d6e5645d4f18bf04d/heystac-0.0.1.tar.gz",
"platform": null,
"description": "# heystac\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/gadomski/heystac/ci.yaml?style=for-the-badge)](https://github.com/gadomski/heystac/actions/workflows/ci.yaml)\n\nA command-line utility (CLI) for rating and crawling [STAC](https://stacspec.org/) catalogs.\n**heystac** generates the ratings for <https://www.gadom.ski/heystac/>.\n\n## Usage\n\n```shell\npython -m pip install heystac\nheystac --help\n```\n\nTo [rate](#rate) a STAC catalog, collection, or item:\n\n```shell\n$ heystac rate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st/items/LC09_L2SP_090091_20241118_20241119_02_T2_ST\n5.0 \u2605\u2605\u2605\u2605\u2605\n```\n\nAny issues will be printed to standard output:\n\n```shell\n\n$ heystac rate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st\n1.7 \u2605\u2605\n\nHigh importance issues\n+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Rule id | Message |\n+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| 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 |\n+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+\n```\n\nTo run [json-schema](https://json-schema.org/) validation on a STAC value:\n\n```shell\n$ heystac validate https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-st 2>&1 | tail -n7\nFailed validating 'pattern' in schema['allOf'][0]['properties']['license']:\n {'title': 'Collection License Name',\n 'type': 'string',\n 'pattern': '^[\\\\w\\\\-\\\\.\\\\+]+$'}\n\nOn instance['license']:\n 'https://d9-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/s3fs-public/atoms/files/Landsat_Data_Policy.pdf'\n```\n\nTo [crawl](#crawl) a catalog and save the crawl to a directory:\n\n```shell\nheystac crawl https://landsatlook.usgs.gov/stac-server usgs-landsat\n```\n\n## Definitions\n\nWe've made some opinionated decisions about behavior in this CLI.\n\n### Rate\n\nA `Rating` is generated by applying a set of `Rules` to a STAC value.\nThis produces one `Check` per rule.\nEach `Check` has a score between zero and one:\n\n- `0`: the STAC value failed the check\n- `1`: the STAC value passed the check\n- Something between `0` and `1`: 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\n\nEach rule also has an `Importance`:\n\n- `high`\n- `medium`\n- `low`\n\n**heystac** applies a configurable weight to each check based on its importance to produce a `score` for the STAC value.\nThat score is converted to `stars` by the following formula: `5 * score / total`, where `total` is the maximum possible score.\n\n### Crawl\n\nWhen **heystac** crawls a STAC API, it gets every collection and one item from each collection.\nThe catalog is saved to the local filesystem in the following layout:\n\n- `catalog.json`\n- `collection-a/collection.json`\n- `collection-a/item-from-collection-a.json`\n- `collection-b/collection.json`\n- `collection-b/item-from-collection-b.json`\n\nThe item file names are generated from the item ID, with all `/` characters replaced by `_`.\n\n## Configuration\n\n**heystac** comes with a default configuration that should work for most use-cases.\nIf you want to customize anything, such as the importance weights or the rule descriptions, save the default configuration to a file called `heystac.toml`:\n\n```shell\nheystac config > heystac.toml\n```\n\nYou can then edit that file to your heart's content.\nBy default, the CLI will read `heystac.toml` in your current working directory.\nTo specify a config file in another location:\n\n```shell\nheystac --config a/nother/path/config.toml\n```\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": "Copyright 2024 Pete Gadomski <pete.gadomski@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Command-line interface (CLI) to rate and crawl STAC",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [
"stac"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "87d746d59aa798e0da91908d64de7fffc8f3f6e32ee12372fbb174551c39ebdc",
"md5": "0b230bf4bb4df0f09a27b13607f7e8eb",
"sha256": "81f6cc80029133a59c975c0b3fe5712cb293e96f62265808085bcfbb5883ef08"
},
"downloads": -1,
"filename": "heystac-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b230bf4bb4df0f09a27b13607f7e8eb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 16394,
"upload_time": "2024-11-19T19:21:27",
"upload_time_iso_8601": "2024-11-19T19:21:27.333264Z",
"url": "https://files.pythonhosted.org/packages/87/d7/46d59aa798e0da91908d64de7fffc8f3f6e32ee12372fbb174551c39ebdc/heystac-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "51207d97919b8005de2011a878e3dc26220890445e76a56d6e5645d4f18bf04d",
"md5": "2221243f405cb080fa85a32a62d117d7",
"sha256": "577d89230fbca376dd7a6bf4635b17b97e52f945527448182b00fe4ebdd593bb"
},
"downloads": -1,
"filename": "heystac-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "2221243f405cb080fa85a32a62d117d7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 128188,
"upload_time": "2024-11-19T19:21:28",
"upload_time_iso_8601": "2024-11-19T19:21:28.880969Z",
"url": "https://files.pythonhosted.org/packages/51/20/7d97919b8005de2011a878e3dc26220890445e76a56d6e5645d4f18bf04d/heystac-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 19:21:28",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "heystac"
}