Coder Social home page Coder Social logo

jupyterplutoconverter.jl's Introduction

JupyterPlutoConverter.jl

Build Status Coverage

Another Jupyter notebook to Pluto converter.

By using Pluto's Notebook and Cell structs, the core functionality of this package is implemented in around 30 lines of code.

Installation

To install this package, open the Julia REPL and run:

julia> ]add JupyterPlutoConverter

Getting started

This package currently supports one-way conversions from Jupyter to Pluto. A single function jupyter2pluto is exported:

using JupyterPlutoConverter

# Convert notebook:
jupyter2pluto("notebook.ipynb") # use default output filename "notebook.jl"
jupyter2pluto("notebook.ipynb", "my_pluto_notebook.jl") # use custom output filename

# Convert directory:
jupyter2pluto(".") # convert all Jupyter notebooks in current directory
jupyter2pluto(".", recursive=true) # recursively look through subdirectories

The following keyword arguments can be specified:

Name Default Description
fold_md true If true, Markdown cells are folded, hiding their source.
wrap_block false If true, code cells with multiple lines of code are wrapped in begin ... end blocks.
overwrite false If true, files at the specified output path will be overwritten.
recursive false If true, applying jupyter2pluto to a directory will recursively look for Jupyter notebooks in sub-directories.
verbose true Toggle verbosity.
transform_code identity Transformation applied to code cells. Has to be a function that maps strings to strings.
transform_md identity Transformation applied to Markdown cells. Has to be a function that maps strings to strings.

Caveats

As the Pluto.jl โ‡† Jupyter conversion notebook summarizes, all automatic conversions from Jupyter to Pluto have caveats:

Pluto is different from Jupyter in many ways - the conversion will not be perfect. Pluto has restrictions on what kind of code you can write (no multiple definitions, for example), and it can be frustrating to start out with a notebook that contains a lot of these 'reactivity errors'.

Try it out, but remember that it might be easier to start the Pluto notebook 'from scratch' and copy code cell-by-cell. Pluto is designed for a different style of writing - this will be difficult to appreciate when you start out with a Jupyter notebook.

Reactivity makes this process more fun than you might think!

Related works

jupyterplutoconverter.jl's People

Contributors

adrhill avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

jupyterplutoconverter.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.