o
    i	                     @   s   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
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                 C   sT   t j| \}}|dkrd}n|dkrd}n|dkrd}n| }| d } 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.
    z.ipynbjsonz.jsonz.pypy)ospathsplitext)fnamebasenameextformat r(   O/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nbformat/v3/__init__.pyr   @   s   
r   )#__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(   r(   r)   <module>   s     8