
    nh              
          d dl Z d dlZd dlZd dlZd dlZddlmZmZmZm	Z	m
Z
mZmZ ddlmZmZmZmZmZmZmZmZmZmZ ddlmZmZ ddl ddlmZ ddlmZmZm Z  dd	l!m"Z" ejF                  jI                  d
      rd dl%Z%	 d dl&Z&dZ'e'Z)dejT                  d e)ddddddf
dZ+ejT                  dfdZ,ejT                  fdZ-y# e($ r d Z'Y Cw xY w)    N   )
__author____copyright__	__email____license____maintainer____maintainer_email____version__)
XL_CELL_BLANKXL_CELL_BOOLEANXL_CELL_DATEXL_CELL_EMPTYXL_CELL_ERRORXL_CELL_NUMBERXL_CELL_TEXT	XLRDErrorbiff_text_from_numerror_text_from_code)Bookcolname)*)
empty_cell)XLDateErrorxldate_as_datetimexldate_as_tuple)X12Book
IronPythonFc
                    d}
|r|d|
 }nEt         j                  j                  |       } t        | d      5 }|j	                  |
      }ddd       dk(  r|r)t        j                  t        j                  |            }nt        j                  |       }|j                         D ci c]  }t        j                  |      | }}|r'|j                  d       t        j                  ||       d|v r!ddlm} |j!                  ||||||||	      }|S d
|v rt#        d      d|v rt#        d      t#        d      ddlm} |j'                  | |||||||||	
      }|S # 1 sw Y   xY wc c}w )a	  
    Open a spreadsheet file for data extraction.

    :param filename: The path to the spreadsheet file to be opened.

    :param logfile: An open file to which messages and diagnostics are written.

    :param verbosity: Increases the volume of trace material written to the
                      logfile.

    :param use_mmap:

      Whether to use the mmap module is determined heuristically.
      Use this arg to override the result.

      Current heuristic: mmap is used if it exists.

    :param file_contents:

      A string or an :class:`mmap.mmap` object or some other behave-alike
      object. If ``file_contents`` is supplied, ``filename`` will not be used,
      except (possibly) in messages.

    :param encoding_override:

      Used to overcome missing or bad codepage information
      in older-version files. See :doc:`unicode`.

    :param formatting_info:

      The default is ``False``, which saves memory.
      In this case, "Blank" cells, which are those with their own formatting
      information but no data, are treated as empty by ignoring the file's
      ``BLANK`` and ``MULBLANK`` records.
      This cuts off any bottom or right "margin" of rows of empty or blank
      cells.
      Only :meth:`~excelrd.sheet.Sheet.cell_value` and
      :meth:`~excelrd.sheet.Sheet.cell_type` are available.

      When ``True``, formatting information will be read from the spreadsheet
      file. This provides all cells, including empty and blank cells.
      Formatting information is available for each cell.

      Note that this will raise a NotImplementedError when used with an
      xlsx file.

    :param on_demand:

      Governs whether sheets are all loaded initially or when demanded
      by the caller. See :doc:`on_demand`.

    :param ragged_rows:

      The default of ``False`` means all rows are padded out with empty cells so
      that all rows have the same size as found in
      :attr:`~excelrd.sheet.Sheet.ncols`.

      ``True`` means that there are no empty cells at the ends of rows.
      This can result in substantial memory savings if rows are of widely
      varying sizes. See also the :meth:`~excelrd.sheet.Sheet.row_len` method.


    :param ignore_workbook_corruption:

      This option allows to read corrupted workbooks.
      When ``False`` you may face CompDocError: Workbook corruption.
      When ``True`` that exception will be ignored.

    :returns: An instance of the :class:`~excelrd.book.Book` class.
       Nrbs   PKzZIP component_names:
zxl/workbook.xmlr   )xlsx)logfile	verbosityuse_mmapformatting_info	on_demandragged_rowszxl/workbook.binz#Excel 2007 xlsb file; not supportedzcontent.xmlz&Openoffice.org ODS file; not supportedz.ZIP file contents not a known type of workbook)book)
filenamer"   r#   r$   file_contentsencoding_overrider%   r&   r'   ignore_workbook_corruption)ospath
expanduseropenreadzipfileZipFileioBytesIOnamelistr   convert_filenamewritepprint r!   open_workbook_2007_xmlr   r(   open_workbook_xls)r)   r"   r#   r$   r*   r+   r%   r&   r'   r,   peekszpeekfzfnamecomponent_namesr!   bkr(   s                      v/var/www/html/SchoolMeal/SchoolMeal/pds_admin_SchoolMeal/Backend/venv/lib/python3.12/site-packages/excelrd/__init__.pyopen_workbookrE   4   s   f FWf%77%%h/(D! 	"Q66&>D	"}M!:;B*B
 MOKKMZD733D94?ZZMM23MM/73/,,#! /#' - 	B I/ABBO+DEEHII			#+'#= 
  
B Ie	" 	" [s   E 'E- E*c                     ddl m} t               }|j                  | |        ||j                  |j
                  |j                  d||       y)a  
    For debugging: dump an XLS file's BIFF records in char & hex.

    :param filename: The path to the file to be dumped.
    :param outfile: An open file, to which the dump is written.
    :param unnumbered: If true, omit offsets (for meaningful diffs).
    r   )	biff_dumpr)   r"   r   N)biffhrG   r   biff2_8_loadmembase
stream_len)r)   outfile
unnumberedrG   rC   s        rD   dumprP      sE     !	BOO   bffbggr}}a*E    c                     ddl m} t               }|j                  | |        ||j                  |j
                  |j                  |       y)a  
    For debugging and analysis: summarise the file's BIFF records.
    ie: produce a sorted file of ``(record_name, count)``.

    :param filename: The path to the file to be summarised.
    :param outfile: An open file, to which the summary is written.
    r   )biff_count_recordsrH   N)rI   rS   r   rJ   rK   rL   rM   )r)   rN   rS   rC   s       rD   count_recordsrT      sA     *	BOO   rvvrwww?rQ   ).r4   r-   r9   sysr2   r
   r   r   r   r   r   r	   rI   r   r   r   r   r   r   r   r   r   r   r(   r   r   formulasheetr   xldater   r   r   r!   r   version
startswith	encodingsmmapMMAP_AVAILABLEImportErrorUSE_MMAPstdoutrE   rP   rT    rQ   rD   <module>rb      s   
 
 	  
          D D  ;;,'N  JJ$JZ ::% F$ %(JJ @I  Ns   C CC