@archive.command("export")
@click.argument("path", nargs=1, required=True)
@click.option(
"--compression",
"-c",
help="The compression inside the archive. If not provided, 'zstd' will be used. Ignored if archive already exists and 'append' is used.",
type=click.Choice(["zstd", "lz4", "lzma", "none"]),
default=DEFAULT_CHUNK_COMPRESSION.ZSTD.name.lower(), # type: ignore
)
@click.option("--append", "-a", help="Append data to existing archive.", is_flag=True)
@click.option("--no-aliases", "-na", help="Do not store aliases.", is_flag=True)
@click.pass_context
@handle_exception()
def export_archive(ctx, path: str, compression: str, append: bool, no_aliases: bool):
from kiara.interfaces.python_api.base_api import BaseAPI
api: BaseAPI = ctx.obj.base_api
target_store_params = {"compression": CHUNK_COMPRESSION_TYPE[compression.upper()]}
result = api.export_archive(
target_archive=path,
append=append,
target_store_params=target_store_params,
no_aliases=no_aliases,
)
render_config = {"add_field_column": False}
terminal_print_model(
result,
format="terminal",
empty_line_before=None,
in_panel="Exported values",
**render_config,
)