
    e|
                         d Z ddlZddlmZmZ ddlmZmZmZm	Z	m
Z
mZmZ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 ddlmZ ddlmZ ddlmZ ddlmZ  d	Z!dZ"d
 Z#dS )zDThe main API for the v2 notebook format.

Authors:

* Brian Granger
    N   )	downgradeupgrade)NotebookNode
new_authornew_code_cellnew_metadatanew_notebook
new_outputnew_text_cellnew_worksheet)reads)to_notebook)writes   c                     t           j                            |           \  }}|dv rd}n|dk    rd}n	| }| dz   } d}| ||fS )a  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.
    ).ipynbz.jsonjsonz.pypyr   )ospathsplitext)fnamebasenameextformat_s       4lib/python3.11/site-packages/nbformat/v2/__init__.pyparse_filenamer   8   sa    0 G$$U++MHc
!!!	 (G##    )$__doc__r   convertr   r   nbbaser   r   r   r	   r
   r   r   r   nbjsonr   	read_json
reads_jsonr   to_notebook_jsonr   
write_jsonwrites_jsonnbpyread_pyreads_pyto_notebook_pywrite_py	writes_pynbxmlread_xml	reads_xmlto_notebook_xmlnbformatnbformat_minorr    r   r   <module>r6      s   $ 
			 ' ' ' ' ' ' ' '	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ' & & & & & ' ' ' ' ' ' 3 3 3 3 3 3 ( ( ( ( ( ( ) ) ) ) ) ) " " " " " " # # # # # # / / / / / / $ $ $ $ $ $ % % % % % % % $ $ $ $ $ % % % % % % 1 1 1 1 1 1 !$ !$ !$ !$ !$r   