ó
‹'=[c           @   sP  d  Z  d d d d d d d d d	 d
 d d d d d d d d d d d d d d d g Z d d l Z d d l m Z m Z m Z m Z m Z m	 Z	 m
 Z
 m Z m Z m Z m Z m Z d d l m Z m Z d d l m Z m Z d d l m Z d d l m Z m Z d d l m Z m Z d d l m Z d d  l m  Z  m! Z! d! „  Z" d S("   s)   The main API for the v3 notebook format.
t   NotebookNodet   new_code_cellt   new_text_cellt   new_notebookt
   new_outputt   new_worksheett   new_metadatat
   new_authort   new_heading_cellt   nbformatt   nbformat_minort   nbformat_schemat
   reads_jsont   writes_jsont	   read_jsont
   write_jsont   to_notebook_jsont   reads_pyt	   writes_pyt   read_pyt   write_pyt   to_notebook_pyt	   downgradet   upgradet   parse_filenameiÿÿÿÿNi   (   R    R   R   R   R   R   R   R   R   R	   R
   R   (   t   readst   writes(   t   to_notebook(   R   R   c         C   sz   t  j j |  ƒ \ } } | d k r- d } n@ | d k rB d } n+ | d k rW d } n |  } |  d }  d } |  | | f S(   s÷  Parse a notebook filename.

    This function takes a notebook filename and returns the notebook
    format (json/py) and the notebook name. This logic can be
    summarized as follows:

    * notebook.ipynb -> (notebook.ipynb, notebook, json)
    * notebook.json  -> (notebook.json, notebook, json)
    * notebook.py    -> (notebook.py, notebook, py)
    * notebook       -> (notebook.ipynb, notebook, json)

    Parameters
    ----------
    fname : unicode
        The notebook filename. The filename can use a specific filename
        extention (.ipynb, .json, .py) or none, in which case .ipynb will
        be assumed.

    Returns
    -------
    (fname, name, format) : (unicode, unicode, unicode)
        The filename, notebook name and format.
    u   .ipynbu   jsonu   .jsonu   .pyu   py(   t   ost   patht   splitext(   t   fnamet   basenamet   extt   format(    (    s3   lib/python2.7/site-packages/nbformat/v3/__init__.pyR   #   s    			
(#   t   __doc__t   __all__R   t   nbbaseR    R   R   R   R   R   R   R   R   R	   R
   R   t   nbjsonR   R   R   R   R   R   R   R   t   nbpyR   R   R   R   R   t   convertR   R   R   (    (    (    s3   lib/python2.7/site-packages/nbformat/v3/__init__.pyt   <module>   s    R