Error accessing `notebook.metadata.language_info.file_extension`
See original GitHub issueCopied from ExecutableBookProject/MyST-NB#63
jupyter-sphinx
expects the presence of notebook.metadata.language_info.file_extension
here:
https://github.com/jupyter/jupyter-sphinx/blob/970097e01c1b7af04372be202aed572de68d2d20/jupyter_sphinx/execute.py#L259
However, it appears that this is not actual a necessary attribute of the notebook metadata, as exampled by the working notebook below:
{
"nbformat": 4,
"nbformat_minor": 2,
"metadata": {
"language_info": {
"name": "python",
"codemirror_mode": {
"name": "ipython",
"version": 3
}
},
"orig_nbformat": 2,
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"npconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": 3
},
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(use/api)=\n",
"\n",
"# Python API"
]
}
]
}
Note, the notebook was initially created by VS Code:
Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, snippets, and more.
Version: 2020.2.64397
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
perhaps just have notebook.metadata.language_info.get("file_extension", ".py")
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Jupytext documentation
notebook_metadata_filter : By default, Jupytext only exports the kernelspec and jupytext metadata to the text files. Set "jupytext": {" ...
Read more >python - Error when installing ipywidgets jupyterlab extension ...
Error when installing ipywidgets jupyterlab extension on windows 10. I get this error message generated. Any way to go about it?
Read more >The Jupyter Notebook Format — IPython 3.2.1 documentation
Jupyter (né IPython) notebook files are simple JSON documents, containing text, source code, rich media output, and metadata. each segment of the document ......
Read more >The ipynb Jupyter Notebook File Extension - MLJAR
ipynb file extension is used for computational notebooks that can be open with Jupyter Notebook. The Jupyter Notebook was formerly named IPython ...
Read more >Get Studio Notebook and App Metadata - Amazon SageMaker
You can access notebook metadata and App metadata using the Amazon SageMaker Studio UI.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have confirmed, as per jupyter client kernel API, that
file_extension
is a compulsory metadata field in the kernel spec.stupid VS Code lol