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
Disclaimer
This is an experimental project. Use at your own risk.
Usage
Load extension inside a Jupyter notebook:
` %load_ext jupytersourcemagic `
Add code with Cell magic:
` %%source path/to/source.py # code to run `
Run to save and evaluate.
Examples
Save and run a script:
` %%source path/to/source.py print('hello') `
Load an existing source to edit.
` %loadsource path/to/source.py ## when run, cell contents will be replaced with path/to/source.py `
Handle other cell magic annotations:
` %%source path/to/source.sh %%bash echo 'hello' `
Help
Display usage and configuration options:
` %%source? `
Installation
Install and activate dependencies:
[ipywidgets](https://github.com/jupyter-widgets/ipywidgets)
[jupyter-interval-widget](https://github.com/srizzo/jupyter-interval-widget)
Then:
$ pip install jupyter-source-magic
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jupyter-source-magic-0.1.1.tar.gz
.
File metadata
- Download URL: jupyter-source-magic-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36a80ac54a047424ed407522d087372b6c4af2100733e9fb85e6ed2c0a9ceaf0 |
|
MD5 | fc243f7e04840af707d0d1438db68671 |
|
BLAKE2b-256 | e46c2d9edfc9c67dd442ce1e82087dd64a25b019f400a642cb03b5e42cd2c69b |
File details
Details for the file jupyter_source_magic-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: jupyter_source_magic-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99b4f0e247815943008f6930efd951ad1d8df59f4372340e62892ccfecaf76f3 |
|
MD5 | 6b9a75936fa8d180a201411764271b2e |
|
BLAKE2b-256 | 4217f24119eb3db7a2e7336cd8785adad69b02275b836ba11a849cf1f0506bea |