o
    QDiT                     @  s   d dl mZ d dlZ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mZ dd
lmZ ejddejejejejejejejfdddZdS )    )annotationsN)List)Console   )Resource)system   )commonhelpers)consoleexplorenamesource	List[str]r   strtypepathdebugbooltrusted	standardsc              
   C  s   t  }|r|t_|r|t_tj| |d} | s'|s'd}tj||d tjddzt	t| |||d}	|	j
|d}
dd	 |
D }W n ty[ } ztj|||d
 tjddd}~ww tdd|  dS )zoExplore dataset with Visidata

    Please read the commands reference:
    - https://www.visidata.org/man/
    )r   z(Providing "source" or "path" is required)note   )code)r   r   r   datatyper   c                 S  s   g | ]}|j r|j qS  )normpath).0resourcer   r   ^/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/console/commands/explore.py
<listcomp>8   s    z#console_explore.<locals>.<listcomp>)r   	exceptionNzvd  )r   r   r   r   r
   create_sourceprint_errortyperExitr   list	Exceptionprint_exceptionosjoin)r   r   r   r   r   r   r   r   r   r   	resourcespathsr"   r   r   r    console_explore   s2   r/   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   r+   typingr   r&   rich.consoler   r   r   r    r	   r
   r   commandr   resource_namer   r   r   r   r   r/   r   r   r   r    <module>   s$    
