
    dh                     N    S r SSKJr  SSKJrJrJr  SSKJrJ	r	   " S S\5      r
g)zLoads Microsoft Excel files.    )Path)AnyListUnion)UnstructuredFileLoadervalidate_unstructured_versionc                   Z   ^  \ rS rSrSr S
S\\\4   S\S\4U 4S jjjr	S\
4S jrS	rU =r$ )UnstructuredExcelLoader   a\  Load Microsoft Excel files using `Unstructured`.

Like other
Unstructured loaders, UnstructuredExcelLoader can be used in both
"single" and "elements" mode. If you use the loader in "elements"
mode, each sheet in the Excel file will be an Unstructured Table
element. If you use the loader in "single" mode, an
HTML representation of the table will be available in the
"text_as_html" key in the document metadata.

Examples
--------
from langchain_community.document_loaders.excel import UnstructuredExcelLoader

loader = UnstructuredExcelLoader("stanley-cups.xlsx", mode="elements")
docs = loader.load()
	file_pathmodeunstructured_kwargsc                 R   > [        U5      n[        SS9  [        TU ]  " SXS.UD6  g)a  

Args:
    file_path: The path to the Microsoft Excel file.
    mode: The mode to use when partitioning the file. See unstructured docs
      for more info. Optional. Defaults to "single".
    **unstructured_kwargs: Keyword arguments to pass to unstructured.
z0.6.7)min_unstructured_version)r   r   N )strr   super__init__)selfr   r   r   	__class__s       b/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/document_loaders/excel.pyr    UnstructuredExcelLoader.__init__   s,     	N	%wGO9O;NO    returnc                 J    SSK Jn  U" SSU R                  0U R                  D6$ )Nr   )partition_xlsxfilenamer   )unstructured.partition.xlsxr   r   r   )r   r   s     r   _get_elements%UnstructuredExcelLoader._get_elements1   s"    >Rt~~R9Q9QRRr   r   )single)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r   __static_attributes____classcell__)r   s   @r   r
   r
      sU    * Pd#P P  #	P P$St S Sr   r
   N)r&   pathlibr   typingr   r   r   1langchain_community.document_loaders.unstructuredr   r   r
   r   r   r   <module>r,      s%    "  # #(S4 (Sr   