{ } Raw JSON

bundles / nbformat 5.11.1 / nbformat / v3 / parse_filename

function

nbformat.v3:parse_filename

source: /nbformat/v3/__init__.py:64

Signature

def parse_filename(fname)

Summary

Parse a notebook filename.

Extended Summary

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 extension (.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.

Aliases

  • nbformat.v3.parse_filename