Skip to main content

Simple reusable magics.

Project description


Dead simple reusable IPython magics.


pip install magical-magic

Basic Usage

import magical
env = magical.register_jinja2_magic() # returns a jinja environment
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
<IPython.core.display.Javascript object>
data = {'🐮': 'moo', '🐑': 'bah', '🔥': 'burn'}
# Jinja Cell Magics

`%%jinja2` inserts data from the notebook into the template.

## An example of a list

{% for key in data %}* {{key}} - __{{data[key]}}__
{% endfor %}

Jinja Cell Magics

%%jinja2 inserts data from the notebook into the template.

An example of a list

  • 🐮 - moo
  • 🔥 - burn
  • 🐑 - bah

%%mistune -d
## Mistune Cell Magics

`%%mistune` uses a pure Python markdown parser.  For convenience, jinja templates can be used to
tell us about the length of `data` is {{data.__len__()}}.


Running the Build and Tests

pip install -r requirements-dev.txt
python develop
watchmedo tricks tricks.yaml

The watchmedo script will convert your notebooks to scripts and html files. py.test-ipynb will test all notebooks matching test-*.ipynb.

Running the docs

jekyll serve docs -wit

Docs are hosted at http://localhost:4000/magical-magic/.


magical-magic is released as free software under the BSD 3-Clause license.

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 magical-magic, version 0.0.9
Filename, size File type Python version Upload date Hashes
Filename, size magical_magic-0.0.9-py3.5.egg (7.1 kB) File type Egg Python version 3.5 Upload date Hashes View
Filename, size magical-magic-0.0.9.tar.gz (5.0 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