# File extension for jupyter to discriminate between Python and Julia notebooks

**URL:** <https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115>\
**Category:** New to Julia\
**Created:** [April 6, 2022, 5:10pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115 "2022-04-06T17:10:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinmestre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martinmestre/32/215857_2.png) [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Post date:** [April 6, 2022, 5:10pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/1 "2022-04-06T17:10:17Z")

</div>

Hello all, sometimes I use Julia and Python notebooks in VS Code. I would like to have another extension like “notebook.ijl” to discriminate respect to the Python notebooks (.ipynb), and also respect to common “.jl” files.  
Do you know any method from Julia or external (bash) to accomplish that?  
Thank you very much in advance.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 6, 2022, 9:04pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/2 "2022-04-06T21:04:57Z")

</div>

> [@martinmestre](#):
>
> Hello all, sometimes I use Julia and Python notebooks in VS Code. I would like to have another extension like “notebook.ijl” to discriminate respect to the Python notebooks (.ipynb), and also respect to common “.jl” files.

Jupyter nowadays supports over 100 programming languages, but they are all stored in the same format and processed by the same tools, so it makes sense to have a single file extension for all of them.

You can easily detect the language for any given `.ipynb` file by parsing the JSON and looking for the [`language_info` field in the `metadata`](https://ipython.org/ipython-doc/3/notebook/nbformat.html).

If you had to pick a language-specific file extension, I would use `.py.ipynb`, `.jl.ipynb`, etcetera. That way all of the tools will continue to work.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [April 7, 2022, 3:10am UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/3 "2022-04-07T03:10:51Z")

</div>

I use the `Jupytext` extension. The extension allows you to use the language common files (`.jl`, `.py`, etc…) as they were notebooks. The metadata and cell separators are added to the files as comments in the written language. I sincerely prefer this way, as I can just run the Julia script to re-generate many plots and tables without needing to have Jupyter working (in case it breaks, or if I prefer putting the script in a Makefile for a paper, etc…).

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 9, 2022, 5:03pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/4 "2022-04-09T17:03:26Z")

</div>

> [@Henrique\_Becker](#):
>
> I can just run the Julia script to re-generate many plots and tables without needing to have Jupyter working

Note that you can do this anyway with [NBInclude,jl](https://github.com/stevengj/NBInclude.jl) (which can also convert `.ipynb` files to `.jl`).

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [April 9, 2022, 7:13pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/5 "2022-04-09T19:13:09Z")

</div>

Yes, but keeping the notebooks as `.jl` files also helps to see the diff in Git, so I still prefer keeping them as `.jl` and making Jupyter to work with them, than keeping them as `.ipynb` and making Julia able to call them.

---

<div class="post-metadata">

**Author:** ![martinmestre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martinmestre/32/215857_2.png) [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Post date:** [April 9, 2022, 9:29pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/6 "2022-04-09T21:29:19Z")

</div>

Thank you for your reply and suggestions. Well, I see that the python ending in “.ipynb” is hard to avoid. Regards!

---

<div class="post-metadata">

**Author:** ![martinmestre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martinmestre/32/215857_2.png) [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Post date:** [April 9, 2022, 9:32pm UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/7 "2022-04-09T21:32:15Z")

</div>

Thank you for your idea. I searched for Jupytext extension and it requires VS Code Insider version. Have you tried it in the stable VS Code version? Regards!

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [April 10, 2022, 11:26am UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/8 "2022-04-10T11:26:39Z")

</div>

No? I am confused, Jupytext is a Jupyter extension, you run Jupyter inside VS Code? I do not use VS Code, I use Jupyter and Vim (separatedly).

---

<div class="post-metadata">

**Author:** ![martinmestre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martinmestre/32/215857_2.png) [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Post date:** [April 11, 2022, 11:10am UTC](https://discourse.julialang.org/t/file-extension-for-jupyter-to-discriminate-between-python-and-julia-notebooks/79115/9 "2022-04-11T11:10:59Z")

</div>

According to this [page](https://marketplace.visualstudio.com/items?itemName=donjayamanne.vscode-jupytext), Jupytext extension is not supported in the stable version of VS Code. Thanks, I will check this periodically, in case it becomes supported.
