B
    x\,                 @   s|   d Z ddlmZ yddlZddlmZ W n ek
rD   edY nX ejrZddlm	Z
 nddl	m	Z
 dd Zdd	d
ZdS )z* s3 support for remote file interactivity     )compatN)NoCredentialsErrorz/The s3fs library is required to handle s3 files)urlparsec             C   s   t | }|j|j S )z&Returns the url without the s3:// part)	parse_urlZnetlocpath)Zurlresult r   +lib/python3.7/site-packages/pandas/io/s3.py_strip_schema   s    r
   c          	   C   sp   |d krd}t jdd}y|t| |} W n6 tjtfk
rb   t jdd}|t| |} Y nX | d |dfS )NrbF)ZanonT)s3fsZS3FileSystemopenr
   r   FileNotFoundErrorr   )Zfilepath_or_bufferencodingZcompressionmodeZfsr   r   r	   get_filepath_or_buffer   s    r   )NNN)__doc__Zpandasr   r   Zbotocore.exceptionsr   ImportErrorZPY3Zurllib.parser   r   r
   r   r   r   r   r	   <module>   s    