
    e{	                         d Z g 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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
 Z"dS )z)The main API for the v3 notebook format.
)NotebookNodenew_code_cellnew_text_cellnew_notebook
new_outputnew_worksheetnew_metadata
new_authornew_heading_cellnbformatnbformat_minornbformat_schema
reads_jsonwrites_json	read_json
write_jsonto_notebook_jsonreads_py	writes_pyread_pywrite_pyto_notebook_py	downgradeupgradeparse_filename    N   )r   r   )r   r   r   r   r	   r   r
   r   r   r   r   r   )reads)to_notebook)writesc                     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/v3/__init__.pyr   r   @   sa    0 G$$U++MHc
!!!	 (G##    )#__doc____all__r$   convertr   r   nbbaser   r   r   r   r	   r   r
   r   r   r   r   r   nbjsonr   r   r   r   r   r   r   r   nbpyr   r   r   r   r   r    r,   r+   <module>r4      s     8 
			 ' ' ' ' ' ' ' '                            ' & & & & & ' ' ' ' ' ' 3 3 3 3 3 3 ( ( ( ( ( ( ) ) ) ) ) ) " " " " " " # # # # # # / / / / / / $ $ $ $ $ $ % % % % % %!$ !$ !$ !$ !$r,   