Skip to main content
=========
Elm Magic
=========

:Author: Ali Rathore

Introduces a %%elm magic.

Compile and display Elm code in IPython and Jupyter notebooks

.. image:: https://raw.github.com/ali--/elm_magic/master/docs/screenshot1.png

.. image:: https://img.shields.io/pypi/v/elm_magic.svg
:target: https://pypi.python.org/pypi/elm_magic

.. image:: https://img.shields.io/travis/ali--/elm_magic.svg
:target: https://travis-ci.org/ali--/elm_magic

.. image:: https://readthedocs.org/projects/elm-magic/badge/?version=latest
:target: https://elm-magic.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://pyup.io/repos/github/ali--/elm_magic/shield.svg
:target: https://pyup.io/repos/github/ali--/elm_magic/
:alt: Updates

Elm Magic provides IPython magic commands that execute elm-lang code

SYNOPSYS
--------

.. code-block:: python

In [1]: %load_ext elm_magic

In [2]: %%elm
...: import Html exposing (text)
...: main =
...: text "Hello World"
Out[2]:
...: Hello World

In [3]: %%elm -i elm-lang/http elm-lang/mouse -w /tmp/myelmdir
...: <elm source code>

This magic will:
(1) use working dir as /tmp/myelmdir (or a new temporary dir)
(2) install elm-lang/http and elm-lang/mouse with elm-package install
(3) compile the cell input with elm-make
(4) display the cell output as html

The -r flag renders the cell contents with elm-static-html
The cell must look exactly like this:

.. code-block:: python

In [4]: %%elm -r
...: module Main exposing (..)
...: import Html exposing (text)
...: view =
...: text "Hello World"
Out[4]:
...: Hello World


USAGE
-----

Install using github::

git clone git@github.com:ali--/elm_magic.git
cd elm_magic
pip install -e .
..


If elm and nodejs are not installed, you can try::

elm_magic install --target <install-dir>

where <install-dir> is writable by the current user.
and in the user's PATH (e.g /usr/local/ or /opt/conda)

Load the magic extension in IPython or Jupyter::

%load_ext elm_magic

then start using the %%elm magic::

%%elm
... elm-lang code ...


CONFIGURATION
-------------

see or set configuration parameters::

%config ElmMagic

Features
--------

* provides %%elm magic that executes elm-lang and displayes the result
* can be used with any jupyter kernel
* directory used by elm-make is configurable
* provides cli for installing nodejs and elm

Credits
---------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
Started with the help of https://github.com/abingham/jupyter-elm-kernel

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

* Free software: GNU General Public License v3
* Documentation: https://elm-magic.readthedocs.io.




=======
History
=======

0.1.0 (2017-06-11)
------------------

* First release on PyPI.


Metadata

Release files for elm-magic 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elm-magic 0.1.0
File Size Uploaded Provenance Actions
elm_magic-0.1.0.tar.gz 62.7 kB Without provenance Details for elm_magic-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elm-magic 0.1.0
File Interpreter ABI Platform Actions
elm_magic-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for elm_magic-0.1.0-py2.py3-none-any.whl

Total release size: 72.2 kB

Release files / elm_magic-0.1.0.tar.gz

Download URL elm_magic-0.1.0.tar.gz
Size 62.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6c2ba3367ef3e08dff13ef25e0ce639009cf046706eb1da38fbe4b9f852899a6
BLAKE2b-256 checksum
How to use checksums
cfa7f6b6327eefc37fb1d0637f30ae793106990b68e164c835da90ae4511480f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / elm_magic-0.1.0-py2.py3-none-any.whl

Download URL elm_magic-0.1.0-py2.py3-none-any.whl
Size 9.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e048a71ced6f976f1d3505009aa3425940bf10a2793277c313a737b51128c592
BLAKE2b-256 checksum
How to use checksums
d51dcc811e666186607d6518304de0a9d8b482d3e866e3d6ff4aa5c6e8e33b1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for elm-magic 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page