o
    QD©ic
  ã                   @  s¶   d dl mZ d dlmZmZmZmZmZ erRd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	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ G dd„ dƒZdS )é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚListÚOptionalÚTypeé   )ÚCheck)ÚControl)ÚError)ÚPackage)ÚStep)ÚResource)ÚFieldé   )ÚAdapter)ÚLoader)ÚParserc                   @  s¨   e Zd ZdZd8dd„Zddd	d
œd9dd„Zd:dd„Zd;dd„Zd<dd„Zd=d>d"d#„Z	d=d?d%d&„Z
d=d@d(d)„Zd=dAd+d,„Zd=dBd.d/„Z	d=dd0œdCd3d4„Zd=dDd6d7„ZdS )EÚPluginz Plugin representation

    It's an interface for writing Frictionless plugins.
    You can implement one or more methods to hook into Frictionless system.

    Úresourcer   ÚreturnúOptional[Loader]c                 C  ó   dS )z‰Create loader

        Parameters:
            resource (Resource): loader resource

        Returns:
            Loader: loader
        N© ©Úselfr   r   r   úS/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/system/plugin.pyÚcreate_loader   ó   	zPlugin.create_loaderNF)ÚcontrolÚbasepathÚ	packagifyÚsourcer   r   úOptional[Control]r    úOptional[str]r!   ÚboolúOptional[Adapter]c                C  r   )zeCreate adapter

        Parameters:
            source: source
            control: control

        Nr   )r   r"   r   r    r!   r   r   r   Úcreate_adapter'   s   zPlugin.create_adapterúOptional[Parser]c                 C  r   )z‰Create parser

        Parameters:
            resource (Resource): parser resource

        Returns:
            Parser: parser
        Nr   r   r   r   r   Úcreate_parser8   r   zPlugin.create_parserÚNonec                 C  r   )zeHook into resource detection

        Parameters:
            resource (Resource): resource

        Nr   r   r   r   r   Údetect_resourceC   s   zPlugin.detect_resourceÚ
candidatesúList[dict[str, Any]]c                 C  r   )z‰Detect field candidates

        Returns:
            dict[]: an ordered by priority list of type descriptors for type detection
        Nr   )r   r,   r   r   r   Údetect_field_candidatesL   s   zPlugin.detect_field_candidatesÚtypeúOptional[Type[Check]]c                 C  ó   d S ©Nr   ©r   r/   r   r   r   Úselect_check_classT   ó   zPlugin.select_check_classúOptional[Type[Control]]c                 C  r1   r2   r   r3   r   r   r   Úselect_control_classW   r5   zPlugin.select_control_classúOptional[Type[Error]]c                 C  r1   r2   r   r3   r   r   r   Úselect_error_classZ   r5   zPlugin.select_error_classúOptional[Type[Field]]c                 C  r1   r2   r   r3   r   r   r   Úselect_field_class]   r5   zPlugin.select_field_classúOptional[Type[Package]]c                 C  r1   r2   r   r3   r   r   r   Úselect_package_class`   r5   zPlugin.select_package_class)Údatatyper>   úOptional[Type[Resource]]c                C  r1   r2   r   )r   r/   r>   r   r   r   Úselect_resource_classc   s   zPlugin.select_resource_classúOptional[Type[Step]]c                 C  r1   r2   r   r3   r   r   r   Úselect_step_classh   r5   zPlugin.select_step_class)r   r   r   r   )
r"   r   r   r#   r    r$   r!   r%   r   r&   )r   r   r   r(   )r   r   r   r*   )r,   r-   r   r*   r2   )r/   r$   r   r0   )r/   r$   r   r6   )r/   r$   r   r8   )r/   r$   r   r:   )r/   r$   r   r<   )r/   r$   r>   r$   r   r?   )r/   r$   r   rA   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r'   r)   r+   r.   r4   r7   r9   r;   r=   r@   rB   r   r   r   r   r      s(    
	ú


	ÿÿr   N)Ú
__future__r   Útypingr   r   r   r   r   Ú	checklistr	   Údialectr
   Úerrorr   Úpackager   Úpipeliner   r   r   Úschemar   Úadapterr   Úloaderr   Úparserr   r   r   r   r   r   Ú<module>   s    