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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__NP_METADATA = Metadata(
    id="6a550274134fb45c8a0bbb1e42e5e8aba7b41891.boutiques",
    name="@np",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VNpOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__np(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfile: OutputPathType
    """Output text file with the appropriate new prefix."""


def v__np(
    prefix: str,
    runner: Runner | None = None,
) -> VNpOutputs:
    """
    Finds an appropriate new prefix to use, given the files you already have in your
    directory. It automatically creates a valid prefix when you are repeatedly
    running similar commands but do not want to delete previous output.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/@np.html
    
    Args:
        prefix: The prefix to be checked.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VNpOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__NP_METADATA)
    cargs = []
    cargs.append("@np")
    cargs.append(prefix)
    ret = VNpOutputs(
        root=execution.output_file("."),
        outfile=execution.output_file("appropriate_prefix.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VNpOutputs",
    "V__NP_METADATA",
    "v__np",
]
