a
    �Ï?eª  ã                   @   s\   d Z ddlmZmZmZ ddlmZ dejejejddœdd„Z	dejeje
d	œd
d„ZdS )z-Provides the API to dump (serialize) objects.é   )ÚcommonÚioinfoÚparsersé   )Ú	datatypesN)ÚdataÚoutÚ	ac_parserÚreturnc                 K   s0   t  |¡}tj||d�}|j| |fi |¤Ž dS )ah  Save ``data`` to ``out`` in specified or detected format.

    :param data: A mapping object may have configurations data to dump
    :param out:
        An output file path, a file, a file-like object, :class:`pathlib.Path`
        object represents the file or a namedtuple 'anyconfig.ioinfo.IOInfo'
        object represents output to dump some data to.
    :param ac_parser: Forced parser type or parser object
    :param options:
        Backend specific optional arguments, e.g. {"indent": 2} for JSON
        loader/dumper backend

    :raises: ValueError, UnknownProcessorTypeError, UnknownFileTypeError
    ©Zforced_typeN)r   Úmaker   ÚfindÚdump)r   r   r	   ÚoptionsZioiÚpsr© r   úV/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/anyconfig/api/_dump.pyr   
   s    
r   )r   r	   r
   c                 K   s    t jd|d�}|j| fi |¤ŽS )aN  Return a str representation of ``data`` in specified format.

    :param data: Config data object to dump
    :param ac_parser: Forced parser type or ID or parser object
    :param options: see :func:`dump`

    :return: Backend-specific string representation for the given data
    :raises: ValueError, UnknownProcessorTypeError
    Nr   )r   r   Údumps)r   r	   r   r   r   r   r   r       s    r   )N)N)Ú__doc__Ú r   r   r   r   Z	InDataExTZPathOrIOInfoTZMaybeParserTr   Ústrr   r   r   r   r   Ú<module>   s    ÿ
þ ÿþ