phidown.cli

Command-line interface for phidown download operations.

This module provides a CLI for downloading Copernicus satellite data products from the Copernicus Data Space Ecosystem using product names or S3 paths.

Attributes

logger

Functions

download_by_name(→ bool)

Download a product by its name from Copernicus Data Space.

download_by_s3path(→ bool)

Download a product directly using its S3 path.

main(→ None)

Main entry point for phidown CLI.

Module Contents

phidown.cli.logger[source]
phidown.cli.download_by_name(product_name: str, output_dir: str, config_file: str = '.s5cfg', show_progress: bool = True, reset_config: bool = False) bool[source]

Download a product by its name from Copernicus Data Space.

Parameters:
  • product_name – Full name of the Copernicus product to download.

  • output_dir – Directory where the product will be downloaded.

  • config_file – Path to s5cmd configuration file with credentials.

  • show_progress – Whether to display download progress bar.

  • reset_config – Whether to reset configuration and prompt for credentials.

Returns:

True if download was successful, False otherwise.

Return type:

bool

Example

>>> success = download_by_name(
...     'S1A_IW_GRDH_1SDV_20240503T031926_20240503T031942_053701_0685FB_E003',
...     '/path/to/output'
... )
phidown.cli.download_by_s3path(s3_path: str, output_dir: str, config_file: str = '.s5cfg', show_progress: bool = True, reset_config: bool = False, download_all: bool = True) bool[source]

Download a product directly using its S3 path.

Parameters:
  • s3_path – S3 path of the product (starting with /eodata/).

  • output_dir – Directory where the product will be downloaded.

  • config_file – Path to s5cmd configuration file with credentials.

  • show_progress – Whether to display download progress bar.

  • reset_config – Whether to reset configuration and prompt for credentials.

  • download_all – If True, downloads entire directory; otherwise specific file.

Returns:

True if download was successful, False otherwise.

Return type:

bool

Example

>>> success = download_by_s3path(
...     '/eodata/Sentinel-1/SAR/IW_GRDH_1S/2024/05/03/...',
...     '/path/to/output'
... )
phidown.cli.main() None[source]

Main entry point for phidown CLI.