CLI documentation#
The stac-asset Command-Line Interface (CLI) provides a text-based way of using the library.
stac-asset#
Work with STAC assets.
See each subcommand’s help text for more information:
$ stac-asset download –help $ stac-asset info –help
stac-asset [OPTIONS] COMMAND [ARGS]...
Options
- -v, --verbosity <LVL>#
Either CRITICAL, ERROR, WARNING, INFO or DEBUG.
download#
Download STAC assets from an item or item collection.
If href is not provided, or is -, the item or item collection is parsed
as JSON from standard input. If the directory is not provided, the current
working directory is used.
These three examples are equivalent, and download the assets to the current working directory:
$ stac-asset download item.json
$ stac-asset download item.json .
$ cat item.json | stac-asset download
To only include certain asset keys:
$ stac-asset download -i asset-key-to-include item.json
stac-asset download [OPTIONS] [HREF] [DIRECTORY]
Options
- -c, --client <client>#
Set the client to use for all downloads. If not provided, the client will be guessed from the asset href.
- Options:
earthdata | s3 | http | planetary-computer | filesystem
- -p, --path-template <path_template>#
String to be interpolated to specify where to store downloaded files
- -a, --alternate-assets <alternate_assets>#
Alternate asset hrefs to prefer, if available
- -i, --include <include>#
Asset keys to include
- -x, --exclude <exclude>#
Asset keys to exclude (can’t be used with include)
- -f, --file-name <file_name>#
The output file name
- -q, --quiet#
Do not print anything to standard output.
- Default:
False
- --s3-requester-pays#
If downloading via the s3 client, enable requester pays
- Default:
False
- --s3-retry-mode <s3_retry_mode>#
If downloading via the s3 client, the retry mode (standard, legacy, and adaptive)
- --s3-max-attempts <s3_max_attempts>#
If downloading via the s3 client, the max number of retries
- --http-max-attempts <http_max_attempts>#
If downloading via the http client, the max number of retries
- --http-timeout <http_timeout>#
Total number of seconds for the whole request
- --http-header <http_headers>#
key=value header pairs to use when making HTTP requests
- -k, --keep#
If warning on error, keep assets that couldn’t be downloaded with their original hrefs. If false, delete those assets from the item.
- Default:
False
- --fail-fast#
Fail immediately on download error, instead of waiting until all are complete.
- Default:
False
- --overwrite#
Overwrite existing files if they exist on the filesystem
- Default:
False
- --max-concurrent-downloads <max_concurrent_downloads>#
The maximum number of downloads that can be active at one time
- --stream <stream>#
Enable, disable, or defer to the client for chunked reading of assets
- Default:
'defer'- Options:
true | false | defer
Arguments
- HREF#
Optional argument
- DIRECTORY#
Optional argument
info#
stac-asset info [OPTIONS] [HREF]
Options
- -a, --alternate-assets <alternate_assets>#
Alternate asset hrefs to prefer, if available
- --s3-requester-pays#
If checking via the s3 client, enable requester pays
- Default:
False
- --s3-retry-mode <s3_retry_mode>#
If checking via the s3 client, the retry mode (standard, legacy, and adaptive)
- --s3-max-attempts <s3_max_attempts>#
If checking via the s3 client, the max number of retries
- --http-max-attempts <http_max_attempts>#
If checking via the http client, the max number of retries
- --http-timeout <http_timeout>#
Total number of seconds for the whole request
Arguments
- HREF#
Optional argument