o
    QD©i)  ã                   @  sr   d dl mZ d dlZddlmZ ddlmZ ddlmZ ddlmZ ej	d	d
dej
ejejejfddd„ƒZdS )é    )ÚannotationsNé   )ÚResource)Úsystemé   )Úcommon)ÚconsoleÚsummaryT)ÚnameÚhiddenÚsourceÚstrÚdebugÚboolÚtrustedÚ	standardsc              
   C  sŒ  |r|t _|r
|t _| sd}tj|dtjjdd t d¡‚z
t| ƒ}| 	¡  W n! t
yI } z|sDtjt|ƒdtjjdd t d¡‚‚ d}~ww t d¡ tjddd t d¡ t t|j ¡ ƒ¡ t d¡ tjd	dd t d¡ t t| ¡ ƒ¡ z| ¡ }W n! t
y¦ } z|s¡tjt|ƒdtjjdd t d¡‚‚ d}~ww t d¡ tjd
dd t t| ¡ ƒ¡ tjt|j ƒd‚)zsSummary of data source.

    It will return schema, sample of the data and validation report for the resource.
    zProviding "source" is requiredT)ÚerrÚfgÚboldé   NÚ z# Describe )r   z
# Extract z# Validate )Úcode)r   r   r   ÚtyperÚsechoÚcolorsÚREDÚExitr   ÚinferÚ	Exceptionr   ÚschemaÚ
to_summaryÚto_viewÚvalidateÚintÚvalid)r   r   r   r   ÚmessageÚresourceÚ	exceptionÚreport© r)   ú^/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/console/commands/summary.pyÚconsole_summary   sN   

€ü




€ü
r+   )r   r   r   r   r   r   r   r   )Ú
__future__r   r   r&   r   r   r   r   r   Úcommandr   r   r   r   r+   r)   r)   r)   r*   Ú<module>   s    û