Skip to main content

A Jupyter Notebook %%magic to quickly edit and run source code

Project description

# Jupyter Source Magic

A Jupyter Notebook %%magic to quickly edit and run source code.

  • Both saves and evaluates source code when cell is run
  • Accepts and evaluates other cell magic annotations, without saving them
  • Deals with existing files and monitors external changes


This is an experimental project. Use at your own risk.


Load extension inside a Jupyter notebook:

` %load_ext jupytersourcemagic `

Add code with Cell magic:

` %%source path/to/ # code to run `

Run to save and evaluate.


Save and run a script:

` %%source path/to/ print('hello') `

Load an existing source to edit.

` %loadsource path/to/ ## when run, cell contents will be replaced with path/to/ `

Handle other cell magic annotations:

` %%source path/to/ %%bash echo 'hello' `


Display usage and configuration options:

` %%source? `


Install and activate dependencies:


$ pip install jupyter-source-magic

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jupyter-source-magic, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size jupyter_source_magic-0.1.2-py3-none-any.whl (6.7 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size jupyter-source-magic-0.1.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page