U
    ÕCd/  ć                   @   s^   d Z ddlmZ ddlmZ ddlmZ dddZddd	Zdd
dZ	dddZ
dddZdS )z¢
Module containing the simple and functional API for rfc3986.

This module defines functions and provides access to the public attributes
and classes of rfc3986.
é   )ŚIRIReference)ŚParseResult)ŚURIReferenceśutf-8c                 C   s   t  | |”S )ab  Parse a URI string into a URIReference.

    This is a convenience function. You could achieve the same end by using
    ``URIReference.from_string(uri)``.

    :param str uri: The URI which needs to be parsed into a reference.
    :param str encoding: The encoding of the string provided
    :returns: A parsed URI
    :rtype: :class:`URIReference`
    )r   Śfrom_string©ŚuriŚencoding© r
   ś//tmp/pip-unpacked-wheel-79v45wuf/rfc3986/api.pyŚuri_reference   s    r   c                 C   s   t  | |”S )ac  Parse a IRI string into an IRIReference.

    This is a convenience function. You could achieve the same end by using
    ``IRIReference.from_string(iri)``.

    :param str iri: The IRI which needs to be parsed into a reference.
    :param str encoding: The encoding of the string provided
    :returns: A parsed IRI
    :rtype: :class:`IRIReference`
    )r   r   )Śirir	   r
   r
   r   Śiri_reference)   s    r   c                 K   s   t  | |”jf |S )ać  Determine if the URI given is valid.

    This is a convenience function. You could use either
    ``uri_reference(uri).is_valid()`` or
    ``URIReference.from_string(uri).is_valid()`` to achieve the same result.

    :param str uri: The URI to be validated.
    :param str encoding: The encoding of the string provided
    :param bool require_scheme: Set to ``True`` if you wish to require the
        presence of the scheme component.
    :param bool require_authority: Set to ``True`` if you wish to require the
        presence of the authority component.
    :param bool require_path: Set to ``True`` if you wish to require the
        presence of the path component.
    :param bool require_query: Set to ``True`` if you wish to require the
        presence of the query component.
    :param bool require_fragment: Set to ``True`` if you wish to require the
        presence of the fragment component.
    :returns: ``True`` if the URI is valid, ``False`` otherwise.
    :rtype: bool
    )r   r   Zis_valid)r   r	   Śkwargsr
   r
   r   Śis_valid_uri7   s    r   c                 C   s   t  | |” ” }| ” S )an  Normalize the given URI.

    This is a convenience function. You could use either
    ``uri_reference(uri).normalize().unsplit()`` or
    ``URIReference.from_string(uri).normalize().unsplit()`` instead.

    :param str uri: The URI to be normalized.
    :param str encoding: The encoding of the string provided
    :returns: The normalized URI.
    :rtype: str
    )r   r   Ś	normalizeZunsplit)r   r	   Znormalized_referencer
   r
   r   Śnormalize_uriP   s    r   c                 C   s   t j| |ddS )a:  Parse a given URI and return a ParseResult.

    This is a partial replacement of the standard library's urlparse function.

    :param str uri: The URI to be parsed.
    :param str encoding: The encoding of the string provided.
    :returns: A parsed URI
    :rtype: :class:`~rfc3986.parseresult.ParseResult`
    F)Śstrict)r   r   r   r
   r
   r   Śurlparse`   s    
r   N)r   )r   )r   )r   )r   )Ś__doc__r   r   Zparseresultr   r   r   r   r   r   r   r   r
   r
   r
   r   Ś<module>   s   



