o
    eLk                     @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZ ddlmZ dZd	Zd
ZdZdZG dd dZG dd dZG dd dZdd ZdddZdddZe  dS )z
    tablib.core
    ~~~~~~~~~~~

    This module implements the central Tablib objects.

    :copyright: (c) 2016 by Kenneth Reitz. 2019 Jazzband.
    :license: MIT, see LICENSE for more details.
    )OrderedDict)copy)
itemgetter)HeadersNeededInvalidDatasetIndexInvalidDatasetTypeInvalidDimensionsUnsupportedFormat)registry)normalize_inputtablibzKenneth ReitzMITz,Copyright 2017 Kenneth Reitz. 2019 Jazzband.restructuredtextc                   @   s   e Zd ZdZddgZd(ddZdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zed!d" Zed#d$ Zd%d& Zd'S ))Rowz/Internal Row object. Mainly used for filtering._rowtags c                 C   s   t || _t || _d S N)listr   r   selfrowr   r   r   >/var/www/html/venv/lib/python3.10/site-packages/tablib/core.py__init__%   s   
zRow.__init__c                 C   s   dd | j D S )Nc                 s   s    | ]}|V  qd S r   r   ).0colr   r   r   	<genexpr>*   s    zRow.__iter__.<locals>.<genexpr>r   r   r   r   r   __iter__)      zRow.__iter__c                 C   
   t | jS r   )lenr   r   r   r   r   __len__,      
zRow.__len__c                 C   r!   r   )reprr   r   r   r   r   __repr__/   r$   zRow.__repr__c                 C   s
   | j | S r   r   r   ir   r   r   __getitem__2   r$   zRow.__getitem__c                 C   s   || j |< d S r   r   )r   r(   valuer   r   r   __setitem__5      zRow.__setitem__c                 C   s   | j |= d S r   r   r'   r   r   r   __delitem__8      zRow.__delitem__c                 C   s   | j | jfS r   r   r   r   r   r   r   __getstate__;   r.   zRow.__getstate__c                 C   s   |\| _ | _d S r   r/   )r   stater   r   r   __setstate__>   r    zRow.__setstate__c                 C   s   |  t| j| d S r   )insertr"   r   r   r*   r   r   r   rpushA   s   z	Row.rpushc                 C   s   |  d| d S )Nr   r3   r4   r   r   r   lpushD   r    z	Row.lpushc                 C   s   |  | d S r   r5   r4   r   r   r   appendG   r,   z
Row.appendc                 C   s   | j || d S r   )r   r3   )r   indexr*   r   r   r   r3   J   s   z
Row.insertc                 C   s
   || j v S r   r   )r   itemr   r   r   __contains__M   r$   zRow.__contains__c                 C   r!   )z%Tuple representation of :class:`Row`.)tupler   r   r   r   r   r=   P      
z	Row.tuplec                 C   r!   )z$List representation of :class:`Row`.)r   r   r   r   r   r   r   U   r>   zRow.listc                 C   s:   |du rdS t |tr|| jv S ttt|t| j@ S )z)Returns true if current row contains tag.NF)
isinstancestrr   boolr"   set)r   tagr   r   r   has_tagZ   s
   

zRow.has_tagN)r   r   )__name__
__module____qualname____doc__	__slots__r   r   r#   r&   r)   r+   r-   r0   r2   r5   r7   r9   r3   r<   propertyr=   r   rD   r   r   r   r   r       s,    


r   c                   @   s  e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd Zdd Zd_ddZd`ddZdd Zdd ZeeeZdd  Zd!d" ZeeeZd#d$ Zed%d& Zed'd( Zdad)d*Zd+d, Zdbd.d/Zdbd0d1Zdbd2d3Zdbd4d5Zdbd6d7Zd8d9 Z d:d; Z!d<d= Z"dcd>d?Z#dad@dAZ$dadBdCZ%dddEdFZ&dddGdHZ'dadIdJZ(dKdL Z)dMdN Z*dOdP Z+dedQdRZ,dSdT Z-dUdV Z.dWdX Z/dYdZ Z0d[d\ Z1dcd]d^Z2dS )fDataseta  The :class:`Dataset` object is the heart of Tablib. It provides all core
    functionality.

    Usually you create a :class:`Dataset` instance in your main module, and append
    rows as you collect data. ::

        data = tablib.Dataset()
        data.headers = ('name', 'age')

        for (name, age) in some_collector():
            data.append((name, age))


    Setting columns is similar. The column data length must equal the
    current height of the data and headers must be set. ::

        data = tablib.Dataset()
        data.headers = ('first_name', 'last_name')

        data.append(('John', 'Adams'))
        data.append(('George', 'Washington'))

        data.append_col((90, 67), header='age')


    You can also set rows and headers upon instantiation. This is useful if
    dealing with dozens or hundreds of :class:`Dataset` objects. ::

        headers = ('first_name', 'last_name')
        data = [('John', 'Adams'), ('George', 'Washington')]

        data = tablib.Dataset(*data, headers=headers)

    :param \*args: (optional) list of rows to populate Dataset
    :param headers: (optional) list strings for Dataset header row
    :param title: (optional) string to use as title of the Dataset


    .. admonition:: Format Attributes Definition

    If you look at the code, the various output/import formats are not
    defined within the :class:`Dataset` object. To add support for a new format, see
    :ref:`Adding New Formats <newformats>`.

    c                 O   sB   t dd |D | _d | _g | _g | _|d| _|d| _d S )Nc                 s   s    | ]}t |V  qd S r   r   )r   argr   r   r   r          z#Dataset.__init__.<locals>.<genexpr>headerstitle)r   _data_Dataset__headers_separators_formattersgetrO   rP   )r   argskwargsr   r   r   r      s   zDataset.__init__c                 C      | j S r   )heightr   r   r   r   r#         zDataset.__len__c                    s`   t |tr|| jv r| j|  fdd| jD S t| j| }t |tr)|jS dd |D S )Nc                       g | ]}|  qS r   r   r   r   posr   r   
<listcomp>       z'Dataset.__getitem__.<locals>.<listcomp>c                 S   s   g | ]}|j qS r   )r=   )r   resultr   r   r   r_      s    )r?   r@   rO   r:   rQ   KeyErrorr   r=   )r   key_resultsr   r]   r   r)      s   



zDataset.__getitem__c                 C   s   |  | t|| j|< d S r   )	_validater   rQ   )r   rc   r*   r   r   r   r+      s   
zDataset.__setitem__c                 C   s`   t |tr*|| jv r(| j|}| j|= t| jD ]\}}||= || j|< qd S t| j|= d S r   )r?   r@   rO   r:   	enumeraterQ   rb   )r   rc   r^   r(   r   r   r   r   r-      s   

zDataset.__delitem__c                 C   &   zd| j   W S  ty   Y dS w )Nz<%s dataset>z<dataset object>rP   lowerAttributeErrorr   r   r   r   r&      
   zDataset.__repr__c                    s   g }| j r|dd | j D  |dd | jD  dd |D }tttt| }| j r9|ddd |D  d	d	d t
|D  d
	 fdd|D S )Nc                 S      g | ]}t |qS r   )r@   )r   hr   r   r   r_      r`   z#Dataset.__str__.<locals>.<listcomp>c                 s   s    | ]
}t tt|V  qd S r   )r   mapr@   r\   r   r   r   r          z"Dataset.__str__.<locals>.<genexpr>c                 S   s   g | ]	}t tt|qS r   )r   rn   r"   r\   r   r   r   r_             c                 S   s   g | ]}d | qS -r   )r   lengthr   r   r   r_      r`   |c                 s   s    | ]}d | V  qdS )z{%s:%s}Nr   )r   r;   r   r   r   r      rN   
c                 3   s    | ]} j | V  qd S r   )formatr\   format_stringr   r   r      s    )rR   r9   extendrQ   r   rn   maxzipr3   joinrf   )r   ra   lens
field_lensr   rx   r   __str__   s   zDataset.__str__c                 K   s   t |j| fi |S r   )r
   
get_format
export_set)r   fmt_keyrW   r   r   r   _get_in_format   s   zDataset._get_in_formatc                 K   s"   t |}t|j| |fi |S r   )r   r
   r   
import_set)r   r   	in_streamrW   r   r   r   _set_in_format   s   zDataset._set_in_formatNFc                    sz   |r j rt| j knd}n$|r't|dk rd}n jr$t| jknd}nt fdd jD }|r7dS |s;tdS )z>Assures size of every row in dataset is of proper proportions.Trq   c                 3   s    | ]
}t | jkV  qd S r   )r"   width)r   xr   r   r   r      ro   z$Dataset._validate.<locals>.<genexpr>F)r   r"   rY   allrQ   r   )r   r   r   safetyis_validr   r   r   re      s   zDataset._validateTc              
      s   t j}|r
t nt jrKt|D ]7\}}jD ]/\}}z"|du r5t|D ]\}}	||	|| |< q'n
||| || |< W q tyI   tw qjrh|r\ fdd|D }
|
S t jgt | }
|
S dd |D }
|
S )z=Packages Dataset into lists of dictionaries for transmission.Nc                    s    g | ]} t tj|qS r   )r   r|   rO   )r   data_row	dict_packr   r   r   r_     s     z$Dataset._package.<locals>.<listcomp>c                 S   rl   r   )r   r\   r   r   r   r_     r`   )	r   rQ   r   dictrT   rf   
IndexErrorr   rO   )r   dictsorderedrQ   row_ir   r   callbackjcdatar   r   r   _package  s4   

zDataset._packagec                 C   rX   )zAn *optional* list of strings to be used for header rows and attribute names.

        This must be set manually. The given list length must equal :attr:`Dataset.width`.

        )rR   r   r   r   r   _get_headers#  s   zDataset._get_headersc                 C   s<   |  | |rzt|| _W dS  ty   tw d| _dS )zValidating headers setter.N)re   r   rR   	TypeError)r   
collectionr   r   r   _set_headers+  s   

zDataset._set_headersc                 C      |   S )a  A native Python representation of the :class:`Dataset` object. If headers have
        been set, a list of Python dictionaries will be returned. If no headers have been set,
        a list of tuples (rows) will be returned instead.

        A dataset object can also be imported by setting the `Dataset.dict` attribute: ::

            data = tablib.Dataset()
            data.dict = [{'age': 90, 'first_name': 'Kenneth', 'last_name': 'Reitz'}]

        )r   r   r   r   r   	_get_dict8  s   zDataset._get_dictc                 C   s   d}|sdS t |tst|t |d tr(|   |D ]	}| t| qdS t |d trN|   t|d  | _|D ]}| tt|	  q>dS t|)a  A native Python representation of the Dataset object. If headers have been
        set, a list of Python dictionaries will be returned. If no headers have been
        set, a list of tuples (rows) will be returned instead.

        A dataset object can also be imported by setting the :attr:`Dataset.dict` attribute. ::

            data = tablib.Dataset()
            data.dict = [{'age': 90, 'first_name': 'Kenneth', 'last_name': 'Reitz'}]

        z[Please check format documentation https://tablib.readthedocs.io/en/stable/formats.html#yamlNr   )
r?   r   r	   wiper9   r   r   keysrO   values)r   pickleerror_detailsr   r   r   r   	_set_dictE  s$   
zDataset._set_dictc                 C   s^   t |}| jr|dg}ng }t|dkr't|d dr't t|d | j}t|| }|S )z,Prepares the given column for insert/append.r   rq   __call__)r   rO   popr"   hasattrrn   rQ   r=   r   r   headerr   r   r   
_clean_coln  s   zDataset._clean_colc                 C   r!   )zfThe number of rows currently in the :class:`Dataset`.
           Cannot be directly modified.
        )r"   rQ   r   r   r   r   rY     s   
zDataset.heightc                 C   sH   zt | jd W S  ty#   zt | jW  Y S  ty"   Y Y dS w w )ziThe number of columns currently in the :class:`Dataset`.
           Cannot be directly modified.
        r   )r"   rQ   r   rO   r   r   r   r   r   r     s   zDataset.widthc                 K   sd   t |}|s
t|}t|}t|dstd| dts&td| d|j| |fi | | S )z
        Import `in_stream` to the :class:`Dataset` object using the `format`.
        `in_stream` can be a file-like object, a string, or a bytestring.

        :param \*\*kwargs: (optional) custom configuration to the format `import_set`.
        r   Format z cannot be imported.)r   detect_formatr
   r   r   r	   r   r   r   rw   rW   streamfmtr   r   r   load  s   

zDataset.loadc                 K   6   t |}t|dstd| d|j| fi |S )z
        Export :class:`Dataset` object to `format`.

        :param \*\*kwargs: (optional) custom configuration to the format `export_set`.
        r   r    cannot be exported.)r
   r   r   r	   r   r   rw   rW   r   r   r   r   export     

zDataset.exportr   c                 C   s$   |  | | j|t||d dS )zInserts a row to the :class:`Dataset` at the given index.

        Rows inserted must be the correct size (height or width).

        The default behaviour is to insert the given row to the :class:`Dataset`
        object at the given index.
       )r   N)re   rQ   r3   r   )r   r:   r   r   r   r   r   r3     s   
	zDataset.insertc                 C      | j | j||d dS )zzAdds a row to the end of the :class:`Dataset`.
        See :method:`Dataset.insert` for additional documentation.
        r   r   N)r3   rY   r   r   r   r   r5        zDataset.rpushc                 C      | j d||d dS )zzAdds a row to the top of the :class:`Dataset`.
        See :method:`Dataset.insert` for additional documentation.
        r   r   Nr6   r   r   r   r   r7        zDataset.lpushc                 C      |  || dS )zoAdds a row to the :class:`Dataset`.
        See :method:`Dataset.insert` for additional documentation.
        Nr8   r   r   r   r   r9        zDataset.appendc                 C   s   |D ]}|  || qdS )z[Adds a list of rows to the :class:`Dataset` using
        :method:`Dataset.append`
        N)r9   )r   rowsr   r   r   r   r   rz     s   zDataset.extendc                 C      | d }| d= |S )z:Removes and returns the first row of the :class:`Dataset`.r   r   r   cacher   r   r   lpop     zDataset.lpopc                 C   r   )9Removes and returns the last row of the :class:`Dataset`.r   r   r   r   r   rpop  r   zDataset.rpopc                 C   r   )r   )r   r   r   r   r   r     s   zDataset.popc                 C   s   |du rg }t |drtt|| j}| |}| j|d | jr:|s&t |r3| jdkr3t	|r3t
| j|| | jrY| jrYt| jD ]\}}||||  || j|< qEdS dd |D | _dS )a  Inserts a column to the :class:`Dataset` at the given index.

        Columns inserted must be the correct height.

        You can also insert a column of a single callable object, which will
        add a new column with the return values of the callable each as an
        item in the column. ::

            data.append_col(col=random.randint)

        If inserting a column, and :attr:`Dataset.headers` is set, the
        header attribute must be set, and will be considered the header for
        that row.

        See :ref:`dyncols` for an in-depth example.

        .. versionchanged:: 0.9.0
           If inserting a column, and :attr:`Dataset.headers` is set, the
           header attribute must be set, and will be considered the header for
           that row.

        .. versionadded:: 0.9.0
           If inserting a row, you can add :ref:`tags <tags>` to the row you are inserting.
           This gives you the ability to :method:`filter <Dataset.filter>` your
           :class:`Dataset` later.

        Nr   r   r   c                 S   s   g | ]}t |gqS r   rL   r\   r   r   r   r_   5  s    z&Dataset.insert_col.<locals>.<listcomp>)r   r   rn   rQ   r   re   rO   r   rY   r"   r   r3   r   rf   )r   r:   r   r   r(   r   r   r   r   
insert_col  s$   

zDataset.insert_colc                 C   r   )z}Adds a column to the end of the :class:`Dataset`.
        See :method:`Dataset.insert` for additional documentation.
        r   N)r   r   r   r   r   r   	rpush_col7  r   zDataset.rpush_colc                 C   r   )z}Adds a column to the top of the :class:`Dataset`.
        See :method:`Dataset.insert` for additional documentation.
        r   r   N)r   r   r   r   r   	lpush_col>  r   zDataset.lpush_colrs   c                 C   s   ||f}| j | dS )z4Adds a separator to :class:`Dataset` at given index.N)rS   r9   )r   r:   textsepr   r   r   insert_separatorE  s   zDataset.insert_separatorc                 C   s<   | j s| jr	| jnd}n
| jr| jd nd}| || dS )z=Adds a :ref:`separator <separators>` to the :class:`Dataset`.r   rq   N)rO   rY   r   )r   r   r:   r   r   r   append_separatorK  s   zDataset.append_separatorc                 C   r   )zvAdds a column to the :class:`Dataset`.
        See :method:`Dataset.insert_col` for additional documentation.
        N)r   r   r   r   r   
append_colV  r   zDataset.append_colc                    s    fdd| j D S )z@Returns the column from the :class:`Dataset` at the given index.c                    r[   r   r   r\   r:   r   r   r_   `  r`   z#Dataset.get_col.<locals>.<listcomp>)rQ   )r   r:   r   r   r   get_col]  s   zDataset.get_colc                 C   sH   t |tr|| jv r| j|}nt|| jks"| j||f dS t)a  Adds a formatter to the :class:`Dataset`.

        .. versionadded:: 0.9.5

        :param col: column to. Accepts index int or header str.
        :param handler: reference to callback function to execute against
                        each cell value.
        T)	r?   r@   rO   r:   rb   r   rT   r9   r   )r   r   handlerr   r   r   add_formatterf  s   



zDataset.add_formatterc                    s"   t | } fdd|jD |_|S )zReturns a new instance of the :class:`Dataset`, excluding any rows
        that do not contain the given :ref:`tags <tags>`.
        c                    s   g | ]	}|  r|qS r   )rD   r\   rC   r   r   r_     rp   z"Dataset.filter.<locals>.<listcomp>)r   rQ   )r   rC   _dsetr   r   r   filter}  s   zDataset.filterc                    s   t |tr3| js
tt| jt||d}t| j| jd}|D ]  fdd| jD }|j	|d q|S | jr;| j| }t| jt||d}t| j| jd}|D ] | jr_ fdd| jD }n }|j	|d qO|S )a  Sort a :class:`Dataset` by a specific column, given string (for
        header) or integer (for column index). The order can be reversed by
        setting ``reverse`` to ``True``.

        Returns a new :class:`Dataset` instance where columns have been
        sorted.
        )rc   reverse)rO   rP   c                       g | ]} | qS r   r   r   rc   r;   r   r   r_     r`   z Dataset.sort.<locals>.<listcomp>r   c                    r   r   r   r   r   r   r   r_     r`   )
r?   r@   rO   r   sortedr   r   rK   rP   r9   )r   r   r   _sortedr   r   r   r   r   sort  s&   
	
zDataset.sortc                 C   sz   | sdS t  }| jd g| | jd   }||_t| jD ]\}}|| jd kr(q|g| | }t|}|j|d q|S )zTranspose a :class:`Dataset`, turning rows into columns and vice
        versa, returning a new ``Dataset`` instance. The first row of the
        original instance becomes the new header row.Nr   r   )rK   rO   rf   r   r   r9   )r   r   new_headersr:   columnrow_datar   r   r   	transpose  s   zDataset.transposec                 C   sZ   t |tsdS | j|jkrtt| }dd |jD }dd |jD }|| ||_|S )zStack two :class:`Dataset` instances together by
        joining at the row level, and return new combined
        ``Dataset`` instance.Nc                 S      g | ]}|qS r   r   r\   r   r   r   r_         z!Dataset.stack.<locals>.<listcomp>c                 S   r   r   r   r\   r   r   r   r_     r   )r?   rK   r   r   r   rQ   rz   )r   otherr   rows_to_stack
other_rowsr   r   r   stack  s   

zDataset.stackc                 C   s   t |tsdS | js|jr| jr|jst| j|jkrtz| j|j }W n ty0   d}Y nw t }| jD ]
}|j| | d q7|jD ]
}|j|| d qE||_|S )zStack two :class:`Dataset` instances together by
        joining at the column level, and return a new
        combined ``Dataset`` instance. If either ``Dataset``
        has headers set, than the other must as well.Nr   )r?   rK   rO   r   rY   r   r   r   )r   r   r   r   r   r   r   r   
stack_cols  s&   


zDataset.stack_colsc                    s(   t    fdd| jD | jdd< dS )ziRemoves all duplicate rows from the :class:`Dataset` object
        while maintaining the original order.c                    s*   g | ]}t | v s t |s|qS r   )r=   addr\   seenr   r   r_     s    $z-Dataset.remove_duplicates.<locals>.<listcomp>N)rB   rQ   r   r   r   r   remove_duplicates  s   
zDataset.remove_duplicatesc                 C   s   t  | _d| _dS )zARemoves all content and headers from the :class:`Dataset` object.N)r   rQ   rR   r   r   r   r   r     s   
zDataset.wipec           	         s    sdS |du rt t j}|du rt  j} fdd|D } fdd|D }t }t ||_g |_t jD ],\}}g }|jD ]}| jv rX j|}|||  qCt	||v rf|jt
|d q:|S )zkReturns a new instance of the :class:`Dataset`,
        including only specified rows and columns.
        Nc                    s   g | ]}|t  jv r|qS r   )rangerY   r\   r   r   r   r_     s    z"Dataset.subset.<locals>.<listcomp>c                    s   g | ]	}| j v r|qS r   )rO   )r   r   r   r   r   r_     rp   r   )r   r   rY   rO   rK   rQ   rf   r:   r9   rb   r   )	r   r   colsr   row_nor   r   rc   r^   r   r   r   subset  s,   



zDataset.subset)NNF)TTr   )r   )NNrr   )F)3rE   rF   rG   rH   r   r#   r)   r+   r-   r&   r   r   r   re   r   r   r   rJ   rO   r   r   r   r   rY   r   r   r   r3   r5   r7   r9   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rK   e   sd    .

"

'








	
;



	
	%!rK   c                   @   s`   e Zd ZdZdddZdd Zdd Zd	d
 Zdd ZdddZ	e
dd Zdd Zdd ZdS )Databookz(A book of :class:`Dataset` objects.
    Nc                 C   s   |pg | _ d S r   	_datasets)r   setsr   r   r   r   7  r,   zDatabook.__init__c                 C   rg   )Nz<%s databook>z<databook object>rh   r   r   r   r   r&   :  rk   zDatabook.__repr__c                 C   s
   g | _ dS )z@Removes all :class:`Dataset` objects from the :class:`Databook`.Nr   r   r   r   r   r   @  s   
zDatabook.wipec                 C   rX   r   r   r   r   r   r   sheetsD  rZ   zDatabook.sheetsc                 C   s   t |tr| j| dS t)z5Adds given :class:`Dataset` to the :class:`Databook`.N)r?   rK   r   r9   r   )r   datasetr   r   r   	add_sheetG  s   
zDatabook.add_sheetTc                 C   s>   g }|rt }nt}| jD ]}|||j|j|dd q|S )z(Packages :class:`Databook` for delivery.)r   )rP   r   )r   r   r   r9   rP   r   )r   r   	collectorr   dsetr   r   r   r   N  s   


zDatabook._packagec                 C   r!   )zDThe number of the :class:`Dataset` objects within :class:`Databook`.)r"   r   r   r   r   r   size^  r>   zDatabook.sizec                 K   sP   t |}|s
t|}t|}t|dstd| d|j| |fi | | S )z
        Import `in_stream` to the :class:`Databook` object using the `format`.
        `in_stream` can be a file-like object, a string, or a bytestring.

        :param \*\*kwargs: (optional) custom configuration to the format `import_book`.
        import_bookr   z cannot be loaded.)r   r   r
   r   r   r	   r   r   r   r   r   r   c  s   

zDatabook.loadc                 K   r   )z
        Export :class:`Databook` object to `format`.

        :param \*\*kwargs: (optional) custom configuration to the format `export_book`.
        export_bookr   r   )r
   r   r   r	   r   r   r   r   r   r   v  r   zDatabook.exportr   )T)rE   rF   rG   rH   r   r&   r   r   r   r   rJ   r   r   r   r   r   r   r   r   3  s    


r   c              
   C   s   t | } d}t D ]@}z2z|| r(|j}W W t| dr%| d  |S  |S W n	 ty2   Y nw W t| dr>| d q
t| drJ| d w w |S )zMReturn format name of given stream (file-like object, string, or bytestring).Nseekr   )r   r
   formatsdetectrP   r   r   rj   )r   	fmt_titler   r   r   r   r     s0   




r   Nc                 K      t  jt| |fi |S zIReturn dataset of given stream (file-like object, string, or bytestring).)rK   r   r   r   rw   rW   r   r   r   r        r   c                 K   r  r  )r   r   r   r  r   r   r   r     r  r   r   )rH   collectionsr   r   operatorr   tablib.exceptionsr   r   r   r   r	   tablib.formatsr
   tablib.utilsr   	__title__
__author____license____copyright____docformat__r   rK   r   r   r   r   register_builtinsr   r   r   r   <module>   s0    
E     SP

