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

import typing
import pathlib
from styxdefs import *
import dataclasses

ABIDS_JSON_TOOL_PY_METADATA = Metadata(
    id="9cd5d1cbe0772f0f1c51d0bd811ef0336e43437f.boutiques",
    name="abids_json_tool.py",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class AbidsJsonToolPyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `abids_json_tool_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def abids_json_tool_py(
    input_file: InputPathType,
    prefix: str,
    del_json: str | None = None,
    values_stay_str: bool = False,
    runner: Runner | None = None,
) -> AbidsJsonToolPyOutputs:
    """
    This script helps to manipulate json files in various ways.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_file: One file to convert. Enter NULL with -add_json to create\
            new json file.
        prefix: Output file name.
        del_json: Remove attribute (KEY) from the -input json file.
        values_stay_str: Each numeric or str item gets saved as a str;\
            otherwise, guess at int and float.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `AbidsJsonToolPyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ABIDS_JSON_TOOL_PY_METADATA)
    cargs = []
    cargs.append("abids_json_tool.py")
    cargs.extend([
        "-input",
        execution.input_file(input_file)
    ])
    cargs.extend([
        "-prefix",
        prefix
    ])
    if del_json is not None:
        cargs.extend([
            "-del_json",
            del_json
        ])
    if values_stay_str:
        cargs.append("-values_stay_str")
    ret = AbidsJsonToolPyOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ABIDS_JSON_TOOL_PY_METADATA",
    "AbidsJsonToolPyOutputs",
    "abids_json_tool_py",
]
