All Projects → mwouts → Jupytext

mwouts / Jupytext

Licence: mit
Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
scheme
763 projects
C++
36643 projects - #6 most used programming language
julia
2034 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jupytext

Xaringan
Presentation Ninja 幻灯忍者 · 写轮眼
Stars: ✭ 1,129 (-77.28%)
Mutual labels:  markdown, rmarkdown, rstudio
Nbdime
Tools for diffing and merging of Jupyter notebooks.
Stars: ✭ 2,135 (-57.03%)
Mutual labels:  jupyter-notebook, jupyterlab-extension, version-control
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (-83.98%)
Mutual labels:  jupyter-notebook, jupyterlab, jupyterlab-extension
Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (-95.98%)
Mutual labels:  jupyter-notebook, jupyterlab, jupyterlab-extension
Jupyter Renderers
Renderers and renderer extensions for JupyterLab
Stars: ✭ 395 (-92.05%)
Mutual labels:  jupyter-notebook, jupyterlab, jupyterlab-extension
Summarytools
R Package to Quickly and Neatly Summarize Data
Stars: ✭ 390 (-92.15%)
Mutual labels:  markdown, rmarkdown, rstudio
Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (-49.23%)
Mutual labels:  jupyter-notebook, jupyterlab, jupyterlab-extension
Wraprmd
RStudio addin for wrapping RMarkdown paragraphs
Stars: ✭ 87 (-98.25%)
Mutual labels:  rmarkdown, knitr, rstudio
Starter Academic
🎓 Easily create a beautiful academic résumé or educational website using Hugo, GitHub, and Netlify
Stars: ✭ 1,158 (-76.7%)
Mutual labels:  markdown, jupyter-notebook, rstudio
Markdowntemplates
✅🔻 A collection of alternate R markdown templates
Stars: ✭ 287 (-94.22%)
Mutual labels:  markdown, rmarkdown
Lantern
Data exploration glue
Stars: ✭ 292 (-94.12%)
Mutual labels:  jupyterlab, jupyterlab-extension
Vimpyter
Edit your Jupyter notebooks in Vim/Neovim
Stars: ✭ 308 (-93.8%)
Mutual labels:  markdown, jupyter-notebook
Jupyterlab Github
GitHub integration for JupyterLab
Stars: ✭ 273 (-94.51%)
Mutual labels:  jupyterlab, jupyterlab-extension
Pander
An R Pandoc Writer: Convert arbitrary R objects into markdown
Stars: ✭ 267 (-94.63%)
Mutual labels:  markdown, rmarkdown
Notebook As Pdf
Save Jupyter Notebooks as PDF
Stars: ✭ 290 (-94.16%)
Mutual labels:  jupyter-notebook, jupyterlab
Doorstop
Requirements management using version control.
Stars: ✭ 258 (-94.81%)
Mutual labels:  markdown, version-control
Jupyterlab Google Drive
Cloud storage for JupyterLab using Google Drive
Stars: ✭ 332 (-93.32%)
Mutual labels:  jupyterlab, jupyterlab-extension
Jupyterlab Sql
SQL GUI for JupyterLab
Stars: ✭ 336 (-93.24%)
Mutual labels:  jupyterlab, jupyterlab-extension
jupyterlab-spreadsheet-editor
JupyterLab spreadsheet editor for tabular data (e.g. csv, tsv)
Stars: ✭ 72 (-98.55%)
Mutual labels:  jupyterlab, jupyterlab-extension
Rmarkdown Cookbook
R Markdown Cookbook. A range of tips and tricks to make better use of R Markdown.
Stars: ✭ 324 (-93.48%)
Mutual labels:  rmarkdown, knitr

CI Documentation Status codecov.io Language grade: Python Code style: black GitHub language count Conda Version Pypi pyversions Binder:notebook Binder:lab

Have you always wished Jupyter notebooks were plain text documents? Wished you could edit them in your favorite IDE? And get clear and meaningful diffs when doing version control? Then... Jupytext may well be the tool you're looking for!

Jupytext is a plugin for Jupyter that can save Jupyter notebooks as either

Use cases

Common use cases for Jupytext are:

  • Doing version control on Jupyter Notebooks
  • Editing, merging or refactoring notebooks in your favorite text editor
  • Applying Q&A checks on notebooks.

Install

You can install Jupytext with

  • pip install jupytext
  • or conda install jupytext -c conda-forge.

Please note that Jupytext includes an extension for Jupyter Lab. In the latest version of Jupytext, this extension is compatible with Jupyter Lab >= 3.0 only. If you use Jupyter Lab 2.x, please either stay with Jupytext 1.8.2, or install, on top of the latest pip or conda version of Jupytext, a version of the extension that is compatible with Jupyter Lab 2.x:

jupyter labextension install [email protected]  # For Jupyter Lab 2.x

Then, restart your Jupyter server (for more installation details, see the install section in the documentation).

When Jupytext is installed, .py and .md files have a notebook icon. And you can really open and run these files as notebooks

    With a click on the text file in Jupyter Notebook

    (click on the image above to try this on Binder)

    With a click on the text file in JupyterLab (New) To do that, you will need to change the default viewer for text notebooks by copy-pasting the following settings (or the subset that matches your use case) in the `Document Manager` section:
    {
      "defaultViewers": {
        "markdown": "Jupytext Notebook",
        "myst": "Jupytext Notebook",
        "r-markdown": "Jupytext Notebook",
        "quarto": "Jupytext Notebook",
        "julia": "Jupytext Notebook",
        "python": "Jupytext Notebook",
        "r": "Jupytext Notebook"
      }
    }

    Here is a screencast of the steps to follow:

    (click on the image above to try this on Binder)

    Another possibility is to activate this with a default_setting_overrides.json file in the .jupyter/labconfig folder with e.g.

    wget https://raw.githubusercontent.com/mwouts/jupytext/main/binder/labconfig/default_setting_overrides.json -P  ~/.jupyter/labconfig/
    

    Note: to open links to .md files in notebooks with the Notebook editor, use jupyterlab>=4.0.0a16.

    With a right click and open with notebook in Jupyter Lab

    (click on the image above to try this on Binder)

Paired notebooks

The most convenient way to use Jupytext is probably through paired notebooks.

To pair a given .ipynb or text notebook to an additional notebook format, use either

    the "pair notebook with..." commands in Jupyter Lab

    the "pair notebook with..." menu entries in Jupyter Notebook

    jupytext at the command line

    with e.g.

    jupytext --set-formats ipynb,py:percent notebook.ipynb
    

    see the documentation.

    or a local or global jupytext.toml configuration file.

    with e.g. the following content:

    formats = "ipynb,py:percent"
    

    see the documentation.

When you save a paired notebook in Jupyter, both the .ipynb file and the text version are updated on disk.

When a paired notebook is opened or reloaded in Jupyter, the input cells are loaded from the text file, and combined with the output cells from the .ipynb file.

You can edit the text representation of the notebook in your favorite editor, and get the changes back in Jupyter by simply reloading the notebook (Ctrl+R in Jupyter Notebook, "reload notebook" in Jupyter Lab). And the changes are propagated to the .ipynb file when you save the notebook.

Alternatively, you can synchronise the two representations by running jupytext --sync notebook.ipynb at the command line.

Which text format?

Jupytext implements many text formats for Jupyter Notebooks. If your notebook is mostly made of code, you will probably prefer to save it as a script:

  • Use the percent format, a format with explicit cell delimiters (# %%), supported by many IDE (Spyder, Hydrogen, VS Code, PyCharm and PTVS)
  • Or use the light format, if you prefer to see fewer cell markers.

If your notebook contains more text than code, if you are writing a documentation or a book, you probably want to save your notebook as a Markdown document

More resources?

If you're new to Jupytext, you may want to start with the FAQ or with the Tutorials, or with this short introduction to Jupytext: .

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].