All Projects → goerz → Jupytext.vim

goerz / Jupytext.vim

Licence: mit
Vim plugin for editing Jupyter ipynb files via jupytext

Projects that are alternatives of or similar to Jupytext.vim

Show ast
An IPython notebook plugin for visualizing ASTs.
Stars: ✭ 76 (-46.48%)
Mutual labels:  jupyter-notebook, ipynb
Fouriertalkoscon
Presentation Materials for my "Sound Analysis with the Fourier Transform and Python" OSCON Talk.
Stars: ✭ 244 (+71.83%)
Mutual labels:  jupyter-notebook, ipynb
Functional intro to python
[tutorial]A functional, Data Science focused introduction to Python
Stars: ✭ 228 (+60.56%)
Mutual labels:  jupyter-notebook, ipynb
Notebooks Statistics And Machinelearning
Jupyter Notebooks from the old UnsupervisedLearning.com (RIP) machine learning and statistics blog
Stars: ✭ 270 (+90.14%)
Mutual labels:  jupyter-notebook, ipynb
Machine learning basics
Plain python implementations of basic machine learning algorithms
Stars: ✭ 3,557 (+2404.93%)
Mutual labels:  jupyter-notebook, ipynb
Data Science Hacks
Data Science Hacks consists of tips, tricks to help you become a better data scientist. Data science hacks are for all - beginner to advanced. Data science hacks consist of python, jupyter notebook, pandas hacks and so on.
Stars: ✭ 273 (+92.25%)
Mutual labels:  jupyter-notebook, ipynb
ipynb notedown.vim
vim plugin for editing jupyter notebook (ipynb) files through notedown
Stars: ✭ 27 (-80.99%)
Mutual labels:  vim-plugins, ipynb
Python intro
Jupyter notebooks in Russian. Introduction to Python, basic algorithms and data structures
Stars: ✭ 538 (+278.87%)
Mutual labels:  jupyter-notebook, ipynb
Yolo Powered robot vision
Stars: ✭ 133 (-6.34%)
Mutual labels:  jupyter-notebook, ipynb
Data Ppf.github.io
website
Stars: ✭ 141 (-0.7%)
Mutual labels:  jupyter-notebook
Notebook
Collection of jupyter notebooks for demonstrating software.
Stars: ✭ 141 (-0.7%)
Mutual labels:  jupyter-notebook
Raspberryturk
The Raspberry Turk is a robot that can play chess—it's entirely open source, based on Raspberry Pi, and inspired by the 18th century chess playing machine, the Mechanical Turk.
Stars: ✭ 140 (-1.41%)
Mutual labels:  jupyter-notebook
Bob Emploi
An application that provides personalized career and job search advice to jobseekers.
Stars: ✭ 141 (-0.7%)
Mutual labels:  jupyter-notebook
Byte Sized Code
A collection of Jupyter notebooks for learning Python from the ground up.
Stars: ✭ 142 (+0%)
Mutual labels:  jupyter-notebook
Notes On Statistical Learning Methods
李航《统计学习方法》中机器学习模型的LaTeX公式笔记
Stars: ✭ 141 (-0.7%)
Mutual labels:  jupyter-notebook
Vtubestudio
Placeholder for VTube Studio
Stars: ✭ 142 (+0%)
Mutual labels:  jupyter-notebook
Www.julialang.org
Julia Project website
Stars: ✭ 140 (-1.41%)
Mutual labels:  jupyter-notebook
Pymatch
Stars: ✭ 139 (-2.11%)
Mutual labels:  jupyter-notebook
Lacmus
Lacmus is a cross-platform application that helps to find people who are lost in the forest using computer vision and neural networks.
Stars: ✭ 142 (+0%)
Mutual labels:  jupyter-notebook
Kdd winniethebest
KDD Cup 2020 Challenges for Modern E-Commerce Platform: Multimodalities Recall first place
Stars: ✭ 142 (+0%)
Mutual labels:  jupyter-notebook

jupytext.vim

Vim/Neovim plugin for editing Jupyter notebook (ipynb) files through jupytext.

https://www.vim.org/scripts/script.php?script_id=5764

Installation

  1. Make sure that you have the jupytext CLI program installed (pip install jupytext).
  2. Copy the jupytext.vim script to your vim plugin directory (e.g. $HOME/.vim/plugin). Refer to :help add-plugin, :help add-global-plugin and :help runtimepath for more details about Vim plugins.
  3. Restart Vim.

Usage

When you open a Jupyter Notebook (*.ipynb) file, it is automatically converted from json to markdown or python through the jupytext utility, and the result is loaded into the buffer. Upon saving, the ipynb file is updated with any modifications.

In more detail, opening a file notebook.ipynb in vim will create a temporary file notebook.md or notebook.py (depending on g:jupytext_fmt). This file is the result of calling e.g.

jupytext --to=md --output notebook.md notebook.ipynb

jupytext.vim screenshot

The contents of the file is loaded into the buffer instead of the original notebook.ipynb. When saving the buffer, its contents is written again to notebook.md, and the original notebook.ipynb is updated with a call to

jupytext --to=ipynb --from=md --update --output notebook.ipynb notebook.md

The --update flag ensures the output for any cell whose corresponding input in notebook.md is unchanged will be preserved.

On closing the buffer, the temporary notebook.md will be deleted. If notebook.md already existed when opening notebook.ipynb, the existing file will be used (instead of being generated by jupytext), and it will be preserved when closing the buffer.

Configuration

The plugin has the following settings. If you want to override the default values shown below, you can define the corresponding variables in your ~/.vimrc.

  • let g:jupytext_enable = 1

    You may disable the automatic conversion of ipynb files (i.e., deactivate this plugin) by setting this to 0.

  • let g:jupytext_command = 'jupytext'

    The CLI jupytext command to use. You may include the full path to point to a specific jupytext executable not in your default $PATH.

  • let g:jupytext_fmt = 'md'

    The format to which to convert the ipynb data. This can be any format that the jupytext utility accepts for its --to parameter (see jupytext --help), except for 'notebook' and 'ipynb'.

  • let g:jupytext_to_ipynb_opts = '--to=ipynb --update'

    Command line options for the conversion from g:jupytext_fmt back to the notebook format

  • let g:jupytext_filetype_map = {}

    A mapping of g:jupytext_fmt to the filetype that should be used for the buffer (:help filetype). This determines the syntax highlighting. You may use this setting to override the default filetype. For example, to use the 'pandoc' filetype instead of the default 'markdown' for the 'md' format, define

    let g:jupytext_filetype_map = {'md': 'pandoc'}
    
  • let g:jupytext_print_debug_msgs = 0

    If set to 1, print debug messages while running the plugin (view with :messages).

Note: If you are using this plugin as a replacement for the ipynb_notedown.vim plugin (https://www.vim.org/scripts/script.php?script_id=5506), you can use the following options to use notedown instead of jupytext:

let g:jupytext_command = 'notedown'
let g:jupytext_fmt = 'markdown'
let g:jupytext_to_ipynb_opts = '--to=notebook'
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].