
    Hf                     \    d Z ddlmZ ddlmZ ddlmZmZ d Zd Z	d Z
d Zd	 Zd
 Zd ZdS )z
    pyexcel.internal.core
    ~~~~~~~~~~~~~~~~~~~~~~

    elementary functions to read and write generic excel content

    :copyright: (c) 2015-2021 by Onni Software Ltd.
    :license: New BSD License
    )SOURCE)DEFAULT_NO_DATA)
BookStreamSheetStreamc                     t          j        di | }|                                \  }}|                                }|r4t	          |                                          \  }}t          ||          S t          t          g g          S )z=
    Get an instance of SheetStream from an excel source
    N )r   
get_sourceget_source_infoget_data_one_sheet_tupleitemsr   r   )keywordsa_sourcefilenamepathsheets
sheet_namedatas          W/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/pyexcel/internal/core.pyget_sheet_streamr      s      ,,8,,H--//NHd  F 2+FLLNN;;
D:t,,,?RD111    c                      t          j        di | }|                                \  }}|                                }t	          |||          S )z
    Get an instance of BookStream from an excel source

    Where the dictionary should have text as keys and two dimensional
    array as values.
    )r   r   r   )r   get_book_sourcer
   r   r   )r   r   r   r   r   s        r   get_book_streamr      sU     %1111H--//NHd  Ffxd;;;;r   c                 D    t          j        di |}t          ||           S )z-
    Save a sheet instance to any source
    r   )r   get_writable_source	_save_any)sheetr   r   s      r   
save_sheetr   *   s*     )55H55HXu%%%r   c                 D    t          j        di |}t          ||           S )z,
    Save a book instance to any source
    r   )r   get_writable_book_sourcer   )bookr   r   s      r   	save_bookr#   2   s*     .::::HXt$$$r   c                     |                      |           	 |                                 }t          |           |S # t          $ r Y d S w xY w)N)
write_dataget_content_seek_at_zeroAttributeError)r   instancecontent_streams      r   r   r   :   sb    !!!!--//n%%%   tts   $< 
A
	A
c                 \    dd l }	 |                     d           d S # |j        $ r Y d S w xY w)Nr   )ioseekUnsupportedOperation)a_streamr,   s     r   r'   r'   D   sM    IIIa"   s    
++c                 X    t          |           } | d         d         | d         d         fS )Nr      )list)r   s    r   r   r   M   s(    KKE8A;a##r   N)__doc__pyexcel.internalr   pyexcel.constantsr   pyexcel.internal.generatorsr   r   r   r   r   r#   r   r'   r   r   r   r   <module>r7      s     $ # # # # # - - - - - - ? ? ? ? ? ? ? ?2 2 2
< 
< 
<& & &% % %    $ $ $ $ $r   