from fastcore.script import *
from fastcore.style import S
from pathlib import Path
from marisco.nc2csv import to_csv
@call_parse
def main(
    src: str,  # Path to the MARIS NetCDF4 file to convert
    dest: str = None,  # Output path stem for the CSV files (defaults to src stem)
) -> None:
    "Convert a MARIS NetCDF4 file to import-ready CSV files (one per sample type)"
    print(f'Decoding: {Path(src).name} ...')
    paths = to_csv(fname_in=src, dest_out=dest)
    print(S.green(f'Done: {len(paths)} CSV file(s) written from {Path(src).name}'))