o
    MEg/                     @   s   d dl mZ d dlmZmZ d dlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ 								dd
ddee dee dee dee defddZd	S )    )Mapping)AnyOptional)JustifyMethod   )box)ReprHighlighter)Pretty)TableNmappingzMapping[Any, Any]titlecaptiontitle_justifycaption_justifyreturnc           	      C   st   t d||tjdd}||_||_|dur||_|dur||_t }|  D ]\}}|	t
||dt
||d q%|S )a  Generate a simple table from a mapping.

    Args:
        mapping (Mapping): A mapping object (e.g. a dict);
        title (str, optional): Optional title to be displayed over the table.
        caption (str, optional): Optional caption to be displayed below the table.
        title_justify (str, optional): Justify method for title. Defaults to None.
        caption_justify (str, optional): Justify method for caption. Defaults to None.

    Returns:
        Table: A table instance which may be rendered by the Console.
    Fblue)show_headerr   r   r   border_styleN)highlighter)r
   r   ROUNDEDr   r   r   r   r   itemsadd_rowr	   )	r   r   r   r   r   tabler   keyvalue r   g/var/www/eduai.edurigo.com/doc_train/edurigo_ai/Puru/venv/lib/python3.10/site-packages/rich/tabulate.pytabulate_mapping   s&   r   )NNNN)collections.abcr   typingr   r   rich.consoler    r   r   r   prettyr	   r   r
   strr   r   r   r   r   <module>   s0    