ó
x\c           @   sĄ   d  Z  d d l m Z y  d d l Z d d l m Z Wn e k
 rU e d   n Xe j rr d d l m	 Z
 n d d l	 m	 Z
 d   Z d d d d  Z d S(	   s*    s3 support for remote file interactivity iĸĸĸĸ(   t   compatN(   t   NoCredentialsErrors/   The s3fs library is required to handle s3 files(   t   urlparsec         C   s   t  |   } | j | j S(   s&   Returns the url without the s3:// part(   t	   parse_urlt   netloct   path(   t   urlt   result(    (    s+   lib/python2.7/site-packages/pandas/io/s3.pyt   _strip_schema   s    c         C   s   | d  k r d } n  t j d t  } y | j t |   |  }  WnD t j t f k
 r t j d t	  } | j t |   |  }  n X|  d  | t	 f S(   Nt   rbt   anon(
   t   Nonet   s3fst   S3FileSystemt   Falset   openR   R    t   FileNotFoundErrorR   t   True(   t   filepath_or_buffert   encodingt   compressiont   modet   fs(    (    s+   lib/python2.7/site-packages/pandas/io/s3.pyt   get_filepath_or_buffer   s    	(   t   __doc__t   pandasR    R   t   botocore.exceptionsR   t   ImportErrort   PY3t   urllib.parseR   R   R   R   R   (    (    (    s+   lib/python2.7/site-packages/pandas/io/s3.pyt   <module>   s   		