diff --git a/README.md b/README.md index 88b73e5..aa775a5 100644 --- a/README.md +++ b/README.md @@ -194,29 +194,36 @@ Usage: databusclient download [OPTIONS] DATABUSURIS... using --convert-to and --convert-from options. Options: +Options: + --localdir TEXT Local databus folder (if not given, databus folder structure is created in current working directory) + --databus TEXT Databus URL (if not given, inferred from databusuri, e.g. https://databus.dbpedia.org/sparql) + --vault-token TEXT Path to Vault refresh token file + --databus-key TEXT Databus API key to download from protected databus + --all-versions When downloading artifacts, download all versions instead of only the latest + + --validate-checksum Validate checksums of downloaded files and fail + on mismatch + --authurl TEXT Keycloak token endpoint URL [default: https://auth.dbpedia.org/realms/dbpedia/protocol - /openid-connect/token] - --clientid TEXT Client ID for token exchange [default: vault- - token-exchange] - --convert-to [bz2|gz|xz] Target compression format for on-the-fly - conversion during download (supported: bz2, gz, - xz) - --convert-from [bz2|gz|xz] Source compression format to convert from - (optional filter). Only files with this - compression will be converted. + openid-connect/token] + + --clientid TEXT Client ID for token exchange [default: + vault-token-exchange] + --help Show this message and exit. + ``` #### Examples of using the download command @@ -318,9 +325,9 @@ Options: --version-id TEXT Target databus version/dataset identifier of the form [required] - --title TEXT Dataset title [required] - --abstract TEXT Dataset abstract max 200 chars [required] - --description TEXT Dataset description [required] + --title TEXT Artifact & version title (applied to both) [required] + --abstract TEXT Artifact & version abstract (max 200 chars; applied to both) [required] + --description TEXT Artifact & version description (applied to both) [required] --license TEXT License (see dalicc.net) [required] --apikey TEXT API key [required] --metadata PATH Path to metadata JSON file (for metadata mode) diff --git a/databusclient/api/download.py b/databusclient/api/download.py index 993dece..9791db5 100644 --- a/databusclient/api/download.py +++ b/databusclient/api/download.py @@ -391,7 +391,6 @@ def _download_file( # for user-friendly CLI output. vault_token = __get_vault_access__(url, vault_token_file, auth_url, client_id) headers["Authorization"] = f"Bearer {vault_token}" - headers["Accept-Encoding"] = "identity" # Retry with token response = requests.get(url, headers=headers, stream=True, timeout=30) diff --git a/databusclient/cli.py b/databusclient/cli.py index 1daa4bb..227a203 100644 --- a/databusclient/cli.py +++ b/databusclient/cli.py @@ -29,9 +29,22 @@ def app(): help="Target databus version/dataset identifier of the form " "", ) -@click.option("--title", required=True, help="Artifact & Version Title: used for BOTH artifact and version. Keep stable across releases; identifies the data series.") -@click.option("--abstract", required=True, help="Artifact & Version Abstract: used for BOTH artifact and version (max 200 chars). Updating it changes both artifact and version metadata.") -@click.option("--description", required=True, help="Artifact & Version Description: used for BOTH artifact and version. Supports Markdown. Updating it changes both artifact and version metadata.") +@click.option( + "--title", + required=True, + help="Artifact & Version Title: used for BOTH artifact and version. Keep stable across releases; identifies the data series.", +) +@click.option( + "--abstract", + required=True, + help="Artifact & Version Abstract: used for BOTH artifact and version (max 200 chars). Updating it changes both artifact and version metadata.", +) +@click.option( + "--description", + required=True, + help="Artifact & Version Description: used for BOTH artifact and version. Supports Markdown. Updating it changes both artifact and version metadata.", +) + @click.option( "--license", "license_url", required=True, help="License (see dalicc.net)" ) @@ -180,8 +193,9 @@ def deploy( @click.option( "--validate-checksum", is_flag=True, - help="Validate checksums of downloaded files" + help="Validate checksums of downloaded files and fail on mismatch" ) + def download( databusuris: List[str], localdir,