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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__DJUNCT_JSON_VALUE_PY_METADATA = Metadata(
    id="b47495fb5ed30256cde903666f72bd8e6155f2a1.boutiques",
    name="@djunct_json_value.py",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VDjunctJsonValuePyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__djunct_json_value_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    modified_json_file: OutputPathType
    """Modified JSON file"""


def v__djunct_json_value_py(
    json_file: InputPathType,
    key: str,
    value: str,
    runner: Runner | None = None,
) -> VDjunctJsonValuePyOutputs:
    """
    A supplementary tool for manipulating JSON values in conjunction with AFNI's
    apqc_py.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/@djunct_json_value.py.html
    
    Args:
        json_file: Input JSON file.
        key: Key in the JSON object to be modified.
        value: Value to be set for the given key.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VDjunctJsonValuePyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__DJUNCT_JSON_VALUE_PY_METADATA)
    cargs = []
    cargs.append("adjunct_json_value")
    cargs.append(execution.input_file(json_file))
    cargs.append(key)
    cargs.append(value)
    ret = VDjunctJsonValuePyOutputs(
        root=execution.output_file("."),
        modified_json_file=execution.output_file(pathlib.Path(json_file).name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VDjunctJsonValuePyOutputs",
    "V__DJUNCT_JSON_VALUE_PY_METADATA",
    "v__djunct_json_value_py",
]
