# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

V_1DCAT_METADATA = Metadata(
    id="6497fba75068a5e9c7d3930e26c7a5f42390e7b0.boutiques",
    name="1dcat",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V1dcatOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_1dcat(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    concatenated_output: OutputPathType
    """Concatenated output in specified format"""


def v_1dcat(
    input_files: list[InputPathType],
    tsv_output: bool = False,
    csv_output: bool = False,
    nonconst_output: bool = False,
    nonfixed_output: bool = False,
    number_format: str | None = None,
    stack_output: bool = False,
    column_row_selection: str | None = None,
    ok_empty: bool = False,
    runner: Runner | None = None,
) -> V1dcatOutputs:
    """
    Concatenates columns of multiple 1D or TSV/CSV files.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_files: Input 1D or TSV/CSV files to concatenate.
        tsv_output: Output in TSV format with tabs as separators and a header\
            line.
        csv_output: Output in CSV format with commas as separators and a header\
            line.
        nonconst_output: Omit columns that are identically constant from the\
            output.
        nonfixed_output: Keep only columns marked as 'free' in the 3dAllineate\
            header.
        number_format: Specify the format of the numbers to be output.
        stack_output: Stack the columns of the resulting matrix in the output.
        column_row_selection: Apply the same column/row selection string to all\
            filenames on the command line.
        ok_empty: Exit quietly when encountering an empty file on disk.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V1dcatOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_1DCAT_METADATA)
    cargs = []
    cargs.append("1dcat")
    cargs.extend([execution.input_file(f) for f in input_files])
    if tsv_output:
        cargs.append("-tsvout")
    if csv_output:
        cargs.append("-csvout")
    if nonconst_output:
        cargs.append("-nonconst")
    if nonfixed_output:
        cargs.append("-nonfixed")
    if number_format is not None:
        cargs.extend([
            "-form",
            number_format
        ])
    if stack_output:
        cargs.append("-stack")
    if column_row_selection is not None:
        cargs.extend([
            "-sel",
            column_row_selection
        ])
    if ok_empty:
        cargs.append("-OKempty")
    ret = V1dcatOutputs(
        root=execution.output_file("."),
        concatenated_output=execution.output_file("stdout"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V1dcatOutputs",
    "V_1DCAT_METADATA",
    "v_1dcat",
]
