Ë
    ž…j÷  ã                  óä   — d Z ddlmZ ddlmZ ddlmZ ddlZddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZ ddlmZmZ erddlmZ  ed«      de	j.                  f	 	 	 dd„«       Z	 d	 	 	 	 	 dd„Zy)zio on the clipboardé    )Úannotations)ÚStringIO)ÚTYPE_CHECKINGN)Úlib)Ú
set_module)Úfind_stack_level)Úcheck_dtype_backend)ÚABCDataFrame)Ú
get_optionÚoption_context)ÚDtypeBackendÚpandasz\s+c                ó  — |j                  dd«      }|�.|j                  «       j                  dd«      dk7  rt        d«      ‚t	        |«       dd	lm} dd
lm}  |«       }	 |j                  |j                  d«      xs t        d«      «      }|dd j                  d«      dd dd }|D �ch c]"  }|j                  d«      j                  d«      ’Œ$ }	}t!        |«      dkD  ryt!        |	«      dk(  rk|	j                  «       dk7  rXd} t!        |d   «      t!        |d   j                  d«      «      z
  }
|
dk7  rD|j#                  dt%        t'        |
«      «      «       nt)        | t*        «      st-        d| ›d�«      ‚t!        | «      dkD  r|j                  d«      €d|d<   nAt!        | «      dkD  r3|j                  d«      dk(  rt/        j0                  dt3        «       ¬«        |t5        |«      f| |dœ|¤ŽS # t        $ r Y �Œtw xY wc c}w )aâ  
    Read text from clipboard and pass to :func:`~pandas.read_csv`.

    Parses clipboard contents similar to how CSV files are parsed
    using :func:`~pandas.read_csv`.

    Parameters
    ----------
    sep : str, default '\\s+'
        A string or regex delimiter. The default of ``'\\s+'`` denotes
        one or more whitespace characters.

    dtype_backend : {'numpy_nullable', 'pyarrow'}
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). If not specified, the default behavior
        is to not use nullable data types. If specified, the behavior
        is as follows:

        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
        * ``"pyarrow"``: returns pyarrow-backed nullable
          :class:`ArrowDtype` :class:`DataFrame`

        .. versionadded:: 2.0

    **kwargs
        See :func:`~pandas.read_csv` for the full argument list.

    Returns
    -------
    DataFrame
        A parsed :class:`~pandas.DataFrame` object.

    See Also
    --------
    DataFrame.to_clipboard : Copy object to the system clipboard.
    read_csv : Read a comma-separated values (csv) file into DataFrame.
    read_fwf : Read a table of fixed-width formatted lines into DataFrame.

    Examples
    --------
    >>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=["A", "B", "C"])
    >>> df.to_clipboard()  # doctest: +SKIP
    >>> pd.read_clipboard()  # doctest: +SKIP
         A  B  C
    0    1  2  3
    1    4  5  6
    Úencodingúutf-8Nú-Ú Úutf8z3reading from clipboard only supports utf-8 encodingr   )Úclipboard_get)Úread_csvzdisplay.encodingi'  ú
éÿÿÿÿé
   ú ú	é   z 	Ú	index_colzsep=z must be a stringÚengineÚpythonÚczIread_clipboard with regex separator does not work properly with c engine.©Ú
stacklevel)ÚsepÚdtype_backend)ÚpopÚlowerÚreplaceÚNotImplementedErrorr	   Úpandas.io.clipboardr   Úpandas.io.parsersr   ÚdecodeÚgetr   ÚAttributeErrorÚsplitÚlstripÚcountÚlenÚ
setdefaultÚlistÚrangeÚ
isinstanceÚstrÚ
ValueErrorÚwarningsÚwarnr   r   )r#   r$   Úkwargsr   r   r   ÚtextÚlinesÚxÚcountsÚindex_lengths              úU/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/pandas/io/clipboards.pyÚread_clipboardrA      sè  € ðj �z‰z˜* gÓ.€Hð Ð §¡Ó 0× 8Ñ 8¸¸bÓ AÀVÒ KÜ!Ð"WÓXÐXä˜Ô&å1Ý*á‹?€DðØ�{‰{˜6Ÿ:™: jÓ1ÒS´ZÐ@RÓ5SÓTˆð ��%ˆL×Ñ˜tÓ$ S bÐ)¨#¨2Ð.€Eð 27Ö7¨Aˆa�h‰h�s‹m×!Ñ! $Õ'Ð7€FÐ7Ü
ˆ5ƒz�A‚~œ#˜f›+¨Ò*¨v¯z©z«|¸qÒ/@Øˆô ˜5 ™8“}¤s¨5°©8¯?©?¸5Ó+AÓ'BÑBˆØ˜1ÒØ×Ñ˜k¬4´°lÓ0CÓ+DÕEä˜œSÔ!Ü˜D˜C˜6Ð!2Ð3Ó4Ð4ô ˆ3ƒx�!‚|˜Ÿ
™
 8Ó,Ð4Ø#ˆˆxÒÜ	ˆS‹�AŠ˜&Ÿ*™* XÓ.°#Ò5Ü�‰ØWÜ'Ó)õ	
ñ
 ”H˜T“NÐS¨¸=ÑSÈFÑSÐSøôK ò Úðüò 8s   Á"-G7 Â-'HÇ7	HÈHc                óh  — |j                  dd«      }|�.|j                  «       j                  dd«      dk7  rt        d«      ‚dd	lm} |€d
}|r>	 |€d}t        «       } | j                  |f|ddœ|¤Ž |j                  «       } ||«       y|�t        j                  dt        «       ¬«       t        | t        «      r(t        dd«      5   | j                   di |¤Ž}ddd«       nt#        | «      } |«       y# t        $ r" t        j                  dt        «       ¬«       Y Œvw xY w# 1 sw Y   Œ@xY w)a®  
    Attempt to write text representation of object to the system clipboard
    The clipboard can be then pasted into Excel for example.

    Parameters
    ----------
    obj : the object to write to the clipboard
    excel : bool, defaults to True
            if True, use the provided separator, writing in a csv
            format for allowing easy pasting into excel.
            if False, write a string representation of the object
            to the clipboard
    sep : optional, defaults to tab
    other keywords are passed to to_csv

    Notes
    -----
    Requirements for your platform
      - Linux: xclip, or xsel (with PyQt4 modules)
      - Windows:
      - OS X:
    r   r   Nr   r   r   z&clipboard only supports utf-8 encodingr   )Úclipboard_setTr   )r#   r   zAto_clipboard in excel mode requires a single character separator.r!   z7to_clipboard with excel=False ignores the sep argument.zdisplay.max_colwidth© )r%   r&   r'   r7   r)   rC   r   Úto_csvÚgetvalueÚ	TypeErrorr8   r9   r   r5   r
   r   Ú	to_stringr6   )	ÚobjÚexcelr#   r:   r   rC   Úbufr;   Úobjstrs	            r@   Úto_clipboardrM   ‡   s4  € ð2 �z‰z˜* gÓ.€Hð Ð §¡Ó 0× 8Ñ 8¸¸bÓ AÀVÒ KÜÐAÓBÐBå1à€}Øˆáð	Øˆ{Ø�Ü“*ˆCð ˆC�J‰J�sÐ@ ¨gÑ@¸Ò@Ø—<‘<“>ˆDá˜$ÔØð 
ˆÜ�‰ØEÜ'Ó)õ	
ô
 �#”|Ô$äÐ2°DÓ9ñ 	-Ø"�S—]‘]Ñ, VÑ,ˆF÷	-ð 	-ô �S“ˆÙ�&Õøô# ò 	Ü�M‰MØSÜ+Ó-÷ð	ú÷	-ð 	-ús   Á<C: Ã
D(Ã:(D%Ä$D%Ä(D1)r#   r6   r$   zDtypeBackend | lib.NoDefault)TN)rJ   zbool | Noner#   z
str | NoneÚreturnÚNone)Ú__doc__Ú
__future__r   Úior   Útypingr   r8   Úpandas._libsr   Úpandas.util._decoratorsr   Úpandas.util._exceptionsr   Úpandas.util._validatorsr	   Úpandas.core.dtypes.genericr
   r   r   r   Úpandas._typingr   Ú
no_defaultrA   rM   rD   ó    r@   ú<module>r\      s’   ðÙ å "å Ý  Û å Ý .Ý 4Ý 7å 3÷ñ
 Ý+ñ ˆHÓàØ25·.±.ðjTØ	ðjTà/òjTó ðjTð\ 7;ðAØðAØ)3ðAà	ôAr[   