a
    |fg	                     @   s:   d Z ddlmZmZ ddlmZmZmZ G dd dZdS )zH
gspread.cell
~~~~~~~~~~~~

This module contains common cells' models.

    )OptionalUnion   )a1_to_rowcol
numericiserowcol_to_a1c                   @   s   e Zd ZdZdeeee ddddZedeed ddd	Z	ed
ddZ
eedddZeed
ddZeed
ddZeeeeef  d
ddZeed
ddZdS )CellzgAn instance of this class represents a single cell
    in a :class:`~gspread.worksheet.Worksheet`.
     N)rowcolvaluereturnc                 C   s   || _ || _|| _d S )N)_row_colr   )selfr
   r   r    r   FD:\Projects\storyit_web\backend\venv\Lib\site-packages\gspread/cell.py__init__   s    zCell.__init__)labelr   r   c                 C   s   t |\}}| |||S )zInstantiate a new :class:`~gspread.cell.Cell`
        from an A1 notation address and a value

        :param string label: the A1 label of the returned cell
        :param string value: the value for the returned cell
        :rtype: Cell
        )r   )clsr   r   r
   r   r   r   r   from_address   s    	zCell.from_address)r   c                 C   s   d | jj| j| jt| jS )Nz<{} R{}C{} {}>)format	__class____name__r
   r   reprr   r   r   r   r   __repr__&   s    zCell.__repr__)otherr   c                 C   s>   t |tsdS | j|jk}| j|jk}| j|jk}|o<|o<|S )NF)
isinstancer   r
   r   r   )r   r   Zsame_rowZsame_colZ
same_valuer   r   r   __eq__.   s    
zCell.__eq__c                 C   s   | j S )z4Row number of the cell.

        :type: int
        )r   r   r   r   r   r
   7   s    zCell.rowc                 C   s   | j S )z7Column number of the cell.

        :type: int
        )r   r   r   r   r   r   ?   s    zCell.colc                 C   s.   t | jdd}t|ts"t|tr&|S dS dS )zNumeric value of this cell.

        Will try to numericise this cell value,
        upon success will return its numeric value
        with the appropriate type.

        :type: int or float
        N)Zdefault_blank)r   r   r   intfloat)r   numeric_valuer   r   r   r"   G   s    
zCell.numeric_valuec                 C   s   t | j| jS )z9Cell address in A1 notation.

        :type: str
        )r   r
   r   r   r   r   r   addressY   s    zCell.address)r	   )r	   )r   
__module____qualname____doc__r    r   strr   classmethodr   r   objectboolr   propertyr
   r   r   r!   r"   r#   r   r   r   r   r      s   	r   N)	r&   typingr   r   utilsr   r   r   r   r   r   r   r   <module>   s   